branch: externals/elpa commit 50f9a698fc6721cd6df5aafac0636bd6776a6930 Author: João Távora <joaotav...@gmail.com> Commit: João Távora <joaotav...@gmail.com>
Fix #433: survive hover responses with empty markdown strings * eglot.el (eglot-help-at-point): Protect against null eglot--hover-info --- eglot.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/eglot.el b/eglot.el index 8fadd5f..d172f4c 100644 --- a/eglot.el +++ b/eglot.el @@ -2255,15 +2255,16 @@ is not active." (eglot--dbind ((Hover) contents range) (jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover (eglot--TextDocumentPositionParams)) - (if (seq-empty-p contents) - (display-local-help) - (let ((blurb (eglot--hover-info contents range)) - (sym (thing-at-point 'symbol))) - (with-current-buffer (eglot--help-buffer) - (with-help-window (current-buffer) - (rename-buffer (format "*eglot-help for %s*" sym)) - (with-current-buffer standard-output (insert blurb)) - (setq-local nobreak-char-display nil))))))) + (let ((blurb (and (not (seq-empty-p contents)) + (eglot--hover-info contents range)))) + (if blurb + (with-current-buffer (eglot--help-buffer) + (with-help-window (current-buffer) + (rename-buffer (format "*eglot-help for %s*" + (thing-at-point 'symbol))) + (with-current-buffer standard-output (insert blurb)) + (setq-local nobreak-char-display nil))) + (display-local-help))))) (defun eglot-doc-too-large-for-echo-area (string) "Return non-nil if STRING won't fit in echo area.