From: João Távora Date: Mon, 20 Aug 2018 22:51:27 +0000 (+0100) Subject: Correctly delete text before expanding snippet completions X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~436 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=93ca152da7dbef8a58a00277a4f7a23222bf0055;p=emacs.git 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 --- 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)))))))