Skip to content

Commit

Permalink
Display truncated docstring if too large for echo area
Browse files Browse the repository at this point in the history
* eglot.el (eglot--eldoc-message): Display first line doc.
  • Loading branch information
joaotavora committed Jan 7, 2019
1 parent d49709d commit 5f7ca17
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))

Expand Down

0 comments on commit 5f7ca17

Please sign in to comment.