]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: inform ElDoc about overly long 'hover' docs
authorJoão Távora <joaotavora@gmail.com>
Thu, 23 Mar 2023 09:04:27 +0000 (09:04 +0000)
committerJoão Távora <joaotavora@gmail.com>
Thu, 23 Mar 2023 21:14:21 +0000 (21:14 +0000)
* lisp/progmodes/eglot.el (eglot-hover-eldoc-function): Include :echo
  info in return value.

lisp/progmodes/eglot.el

index d88647ccbdf35aeb2a2d279670f69f06edd08666..919f44a2d9a99f89f10a478538391ea7b464e7f1 100644 (file)
@@ -3169,7 +3169,8 @@ for which LSP on-type-formatting should be requested."
                      (eglot--when-buffer-window buf
                        (let ((info (unless (seq-empty-p contents)
                                      (eglot--hover-info contents range))))
-                         (funcall cb info :buffer t))))
+                         (funcall cb info
+                                  :echo (and info (string-match "\n" info))))))
        :deferred :textDocument/hover))
     (eglot--highlight-piggyback cb)
     t))