diff --git a/lsp-completion.el b/lsp-completion.el index 97b1555a053..c9b4d99fd58 100644 --- a/lsp-completion.el +++ b/lsp-completion.el @@ -351,6 +351,10 @@ The MARKERS and PREFIX value will be attached to each candidate." (buffer-substring-no-properties (plist-get (text-properties-at 0 candidate) 'lsp-completion-start-point) (point)))) + ;; Workaround for bug #4192 + ;; `lsp-completion-start-point' above might be from cached/previous completion and + ;; pointing to a very distant point, which results in `prefix' being way to long. + (prefix (car (string-lines prefix))) (prefix-len (length prefix)) (prefix-pos 0) (label (downcase candidate))