From 87ea1df50f1659c521684f01bc518eac4bf7b2a0 Mon Sep 17 00:00:00 2001 From: Ivan Yonchovski Date: Wed, 29 Apr 2020 17:40:54 +0300 Subject: [PATCH] do not look back on the first position in the line --- lsp-mode.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lsp-mode.el b/lsp-mode.el index 4910c0ca1e..b448aa615e 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -4176,12 +4176,13 @@ and the position respectively." (defun lsp--looking-back-trigger-characters-p (trigger-characters) "Return trigger character if text before point matches any of the TRIGGER-CHARACTERS." - (seq-some - (lambda (trigger-char) - (and (equal (buffer-substring-no-properties (- (point) (length trigger-char)) (point)) - trigger-char) - trigger-char)) - trigger-characters)) + (unless (= (point) (point-at-bol)) + (seq-some + (lambda (trigger-char) + (and (equal (buffer-substring-no-properties (- (point) (length trigger-char)) (point)) + trigger-char) + trigger-char)) + trigger-characters))) (defvar lsp--capf-cache nil "Cached candidates for completion at point function.