From 93ca152da7dbef8a58a00277a4f7a23222bf0055 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 20 Aug 2018 23:51:27 +0100 Subject: [PATCH] Correctly delete text before expanding snippet completions Suggested by Amol Mandhane. * eglot.el (eglot-completion-at-point): Use length of obj in :exit-function GitHub-reference: close https://github.com/joaotavora/eglot/issues/82 --- lisp/progmodes/eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index eba1b1d1cf9..75871640687 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1464,7 +1464,7 @@ is not active." (text-properties-at 0 obj) (when-let ((fn (and (eql insertTextFormat 2) (eglot--snippet-expansion-fn)))) - (delete-region (car bounds) (point)) + (delete-region (- (point) (length obj)) (point)) (funcall fn insertText)) (eglot--signal-textDocument/didChange) (eglot-eldoc-function))))))) -- 2.39.2