Skip to content

Commit

Permalink
fixup! Truncate hovering information in echo area
Browse files Browse the repository at this point in the history
The string passed to eldoc-message needs to be truncated, otherwise
eldoc-last-message will be displayed with multiple lines.
  • Loading branch information
fbergroth committed Sep 12, 2018
1 parent 2e8c1d8 commit 5c7207a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1548,8 +1548,10 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp."
(when-let (info (and contents
(eglot--hover-info contents
range)))
(let ((message-truncate-lines t))
(eldoc-message info))))))
(let* ((end (min (1- (window-width (minibuffer-window)))
(string-match-p "\n" info)))
(msg (substring info nil end)))
(eldoc-message msg))))))
:deferred :textDocument/hover))
(when (eglot--server-capable :documentHighlightProvider)
(jsonrpc-async-request
Expand Down

0 comments on commit 5c7207a

Please sign in to comment.