]> git.eshelyaron.com Git - emacs.git/commitdiff
Correctly delete text before expanding snippet completions
authorJoão Távora <joaotavora@gmail.com>
Mon, 20 Aug 2018 22:51:27 +0000 (23:51 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 20 Aug 2018 22:53:08 +0000 (23:53 +0100)
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

index eba1b1d1cf966da002511ba8da58566c81359a10..758716406877c1f51a696b96086b9fbe3a92a6a0 100644 (file)
@@ -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)))))))