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

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

[elpa] externals/elpa 50f9a69 25/71: Fix #433: survive hover responses w


From: João Távora
Subject: [elpa] externals/elpa 50f9a69 25/71: Fix #433: survive hover responses with empty markdown strings
Date: Wed, 16 Dec 2020 11:42:18 -0500 (EST)

branch: externals/elpa
commit 50f9a698fc6721cd6df5aafac0636bd6776a6930
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@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.



reply via email to

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