Skip to content

Commit

Permalink
Remove trailing whitespace from `lsp-describe-thing-at-point'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wavexx committed Oct 3, 2024
1 parent 66739e5 commit 1b1f051
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -5405,7 +5405,10 @@ If EXCLUDE-DECLARATION is non-nil, request the server to include declarations."
(delay-mode-hooks
(lsp-help-mode)
(with-help-window lsp-help-buf-name
(insert (string-trim-right (lsp--render-on-hover-content contents t)))))
(insert
(mapconcat 'string-trim-right
(string-split (lsp--render-on-hover-content contents t) "\n")
"\n"))))
(run-mode-hooks)))
(lsp--info "No content at point."))))

Expand Down

0 comments on commit 1b1f051

Please sign in to comment.