From dd45f05341a8de97ec3bd45b52bcc16b3d1d14ef Mon Sep 17 00:00:00 2001 From: Fredrik Bergroth Date: Wed, 12 Sep 2018 14:15:31 +0200 Subject: [PATCH] fixup! Truncate hovering information in echo area The string passed to eldoc-message needs to be truncated, otherwise eldoc-last-message will be displayed with multiple lines. --- eglot.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eglot.el b/eglot.el index e38080ff..f07209a7 100644 --- a/eglot.el +++ b/eglot.el @@ -1548,8 +1548,11 @@ 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))) + (or (string-match-p "\n" info) + (length info)))) + (msg (substring info nil end))) + (eldoc-message msg)))))) :deferred :textDocument/hover)) (when (eglot--server-capable :documentHighlightProvider) (jsonrpc-async-request