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

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

[elpa] master 872b14c 05/38: add the docbuffer on company-yasnippet


From: Dmitry Gutov
Subject: [elpa] master 872b14c 05/38: add the docbuffer on company-yasnippet
Date: Sat, 25 Jul 2020 19:51:11 -0400 (EDT)

branch: master
commit 872b14cea0c27f67723204a14a007ed508666270
Author: stephen <sawakitaeiji233@gmail.com>
Commit: stephen <sawakitaeiji233@gmail.com>

    add the docbuffer on company-yasnippet
---
 company-yasnippet.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/company-yasnippet.el b/company-yasnippet.el
index e5fded4..d5d3346 100644
--- a/company-yasnippet.el
+++ b/company-yasnippet.el
@@ -97,6 +97,13 @@
        res))
    tables))
 
+(defun company-yasnippet--doc (arg)
+  (let ((template (get-text-property 0 'yas-template arg)))
+    (with-current-buffer (company-doc-buffer)
+      (insert (yas--template-content template))
+      (goto-char (point-min))
+      (current-buffer))))
+
 ;;;###autoload
 (defun company-yasnippet (command &optional arg &rest ignore)
   "`company-mode' backend for `yasnippet'.
@@ -134,6 +141,7 @@ shadow backends that come after it.  Recommended usages:
       (unless company-tooltip-align-annotations " -> ")
       (get-text-property 0 'yas-annotation arg)))
     (candidates (company-yasnippet--candidates arg))
+    (doc-buffer (company-yasnippet--doc arg))
     (no-cache t)
     (post-completion
      (let ((template (get-text-property 0 'yas-template arg))



reply via email to

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