Skip to content

Commit

Permalink
Close joaotavora/eglot#82: Correctly delete text before expanding sni…
Browse files Browse the repository at this point in the history
…ppet completions

Suggested by Amol Mandhane.

* eglot.el (eglot-completion-at-point): Use length of obj in
:exit-function
  • Loading branch information
joaotavora committed Aug 20, 2018
1 parent d1a9dfd commit 2605678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))))
Expand Down

0 comments on commit 2605678

Please sign in to comment.