From be4b79fa42271672c9354f5abd5217c73a096d72 Mon Sep 17 00:00:00 2001 From: Jeremy Weed Date: Sat, 9 Nov 2024 23:12:32 -0800 Subject: [PATCH] Fix processing of multibyte messages (#4519) * 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 --- lsp-mode.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lsp-mode.el b/lsp-mode.el index 2d80a59495..47215d8cad 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -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.")))) @@ -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))