]> git.eshelyaron.com Git - emacs.git/commitdiff
Protect against zero-length completions
authorJoão Távora <joaotavora@gmail.com>
Wed, 16 Oct 2019 22:13:09 +0000 (23:13 +0100)
committerJoão Távora <joaotavora@gmail.com>
Wed, 16 Oct 2019 22:13:09 +0000 (23:13 +0100)
Apparently the Vue Language Server sends such things (see https://github.com/joaotavora/eglot/issues/319).

* eglot.el (eglot-completion-at-point): Protect against
zero-length completions.

lisp/progmodes/eglot.el

index aa64fe6a2a9d950af1462c7cdb8cc60c1039eaae..cba8c341b3479cd72f8dcbbdeb518e04b7410a01 100644 (file)
@@ -1907,7 +1907,8 @@ is not active."
                                     (string-trim-left label))
                                    (t
                                     (or insertText (string-trim-left label))))))
-                        (put-text-property 0 1 'eglot--lsp-item item proxy)
+                        (unless (zerop (length proxy))
+                          (put-text-property 0 1 'eglot--lsp-item item proxy))
                         proxy))
                     items))
            (bounds