emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 32e535d 07/38: add syntax highlight


From: Dmitry Gutov
Subject: [elpa] master 32e535d 07/38: add syntax highlight
Date: Sat, 25 Jul 2020 19:51:12 -0400 (EDT)

branch: master
commit 32e535d1c0f3465f2ea187822890539c2a1cbe41
Author: stephen <sawakitaeiji233@gmail.com>
Commit: stephen <sawakitaeiji233@gmail.com>

    add syntax highlight
---
 company-yasnippet.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/company-yasnippet.el b/company-yasnippet.el
index d2f8c96..f2d4fe9 100644
--- a/company-yasnippet.el
+++ b/company-yasnippet.el
@@ -98,11 +98,19 @@
    tables))
 
 (defun company-yasnippet--doc (arg)
-  (let ((template (get-text-property 0 'yas-template arg)))
+  (let ((template (get-text-property 0 'yas-template arg))
+        (mode (format "%s" major-mode)))
     (with-current-buffer (company-doc-buffer)
       (yas-minor-mode 1)
       (yas-expand-snippet (yas--template-content template))
-      (goto-char (point-min))
+      (delay-mode-hooks
+        (let ((inhibit-message t))
+          (if (string-equal mode "web-mode")
+                (progn
+                  (setq mode "html-mode")
+                  (funcall (intern mode)))
+            (funcall (intern mode))))
+         (ignore-errors (font-lock-ensure)))
       (current-buffer))))
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]