Skip to content

Commit 27d6e79

Browse files
authored
Remove trailing whitespace from `lsp-describe-thing-at-point' (#4576)
When calling `lsp-describe-thing-at-point' trailing whitespace can leak into the help buffer. Depending on the face settings, this whitespace can be visibile. Instead of removing trailing whitespace at the end of the buffer, do so on a line-by-line basis. Fixes #4572
1 parent 3893940 commit 27d6e79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lsp-mode.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5409,7 +5409,10 @@ If EXCLUDE-DECLARATION is non-nil, request the server to include declarations."
54095409
(delay-mode-hooks
54105410
(lsp-help-mode)
54115411
(with-help-window lsp-help-buf-name
5412-
(insert (string-trim-right (lsp--render-on-hover-content contents t)))))
5412+
(insert
5413+
(mapconcat 'string-trim-right
5414+
(split-string (lsp--render-on-hover-content contents t) "\n")
5415+
"\n"))))
54135416
(run-mode-hooks)))
54145417
(lsp--info "No content at point."))))
54155418

0 commit comments

Comments
 (0)