From: João Távora Date: Wed, 16 Oct 2019 22:13:09 +0000 (+0100) Subject: Protect against zero-length completions X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~296 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=21c2bb18d898b5d70750688a51346b2b867e3265;p=emacs.git Protect against zero-length completions 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. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index aa64fe6a2a9..cba8c341b34 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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