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

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

[elpa] externals/eglot 9eac9de 16/54: Fix #341: protect against empty-st


From: João Távora
Subject: [elpa] externals/eglot 9eac9de 16/54: Fix #341: protect against empty-string insertText in completions
Date: Thu, 16 Apr 2020 05:31:47 -0400 (EDT)

branch: externals/eglot
commit 9eac9ded9e2449a8e6c4b77ed89c588e0b362b7f
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Fix #341: protect against empty-string insertText in completions
    
    * eglot.el (eglot-completion-at-point): Don't use insertText as a
    proxy.
---
 eglot.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/eglot.el b/eglot.el
index 281a293..80c65ce 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1968,8 +1968,11 @@ is not active."
                                 (cond ((and (eql insertTextFormat 2)
                                             (eglot--snippet-expansion-fn))
                                        (string-trim-left label))
+                                      ((and insertText
+                                            (not (string-empty-p insertText)))
+                                       insertText)
                                       (t
-                                       (or insertText (string-trim-left 
label))))))
+                                       (string-trim-left label)))))
                            (unless (zerop (length item))
                              (put-text-property 0 1 'eglot--lsp-item item 
proxy))
                            proxy))



reply via email to

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