Skip to content

Commit

Permalink
Fix processing of multibyte messages (emacs-lsp#4519)
Browse files Browse the repository at this point in the history
* Fix processing of multibyte messages

* Too many characters are read from back-to-back multibyte messages due to a
conversion from byte-length to character length

* Updated to immediately convert messages to unibyte when processing

* Update encoding logic to avoid copies

---------

Co-authored-by: weedjer <[email protected]>
  • Loading branch information
2 people authored and nvimtor committed Nov 11, 2024
1 parent 39106db commit be4b79f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -5420,9 +5420,9 @@ If EXCLUDE-DECLARATION is non-nil, request the server to include declarations."
(lsp-help-mode)
(with-help-window lsp-help-buf-name
(insert
(mapconcat 'string-trim-right
(split-string (lsp--render-on-hover-content contents t) "\n")
"\n"))))
(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 Expand Up @@ -7074,8 +7074,8 @@ server. WORKSPACE is the active workspace."
leftovers body-length body chunk)
(lambda (_proc input)
(setf chunk (if (s-blank? leftovers)
(encode-coding-string input 'utf-8-unix)
(concat leftovers (encode-coding-string input 'utf-8-unix))))
(encode-coding-string input 'utf-8-unix t)
(concat leftovers (encode-coding-string input 'utf-8-unix t))))

(let (messages)
(while (not (s-blank? chunk))
Expand Down

0 comments on commit be4b79f

Please sign in to comment.