Skip to content

Commit

Permalink
Remove trailing whitespace from `lsp-describe-thing-at-point' (#4576)
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 authored Oct 15, 2024
1 parent 3893940 commit 27d6e79
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 @@ -5409,7 +5409,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
(split-string (lsp--render-on-hover-content contents t) "\n")
"\n"))))
(run-mode-hooks)))
(lsp--info "No content at point."))))

Expand Down

0 comments on commit 27d6e79

Please sign in to comment.