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

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

[elpa] externals/eglot dc371b8 08/69: Display truncated docstring if too


From: João Távora
Subject: [elpa] externals/eglot dc371b8 08/69: Display truncated docstring if too large for echo area
Date: Sun, 20 Oct 2019 08:21:42 -0400 (EDT)

branch: externals/eglot
commit dc371b88746cfe412144aa4b32f3f8926341033c
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Display truncated docstring if too large for echo area
    
    * eglot.el (eglot--eldoc-message): Display first line doc.
---
 eglot.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index 9631c19..2ab4bd8 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2071,8 +2071,12 @@ Buffer is displayed with `display-buffer', which obeys
           (if eglot-auto-display-help-buffer
               (display-buffer (current-buffer))
             (unless (get-buffer-window (current-buffer))
-              (eglot--message "Help for %s is in %s buffer" eglot--eldoc-hint
-                              (buffer-name eglot--help-buffer))))
+              (eglot--message
+               "%s\n(...truncated. Full help is in `%s')"
+               (truncate-string-to-width
+                (replace-regexp-in-string "\\(.*\\)\n.*" "\\1" string)
+                (frame-width) nil nil "...")
+               (buffer-name eglot--help-buffer))))
           (help-mode)
           t)))))
 



reply via email to

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