branch: externals/tempel
commit e529887d5daee652251cead3b2ea7feb2af1434c
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
tempel-expand: Fix exit function
Do not expand when status is 'exact.
---
tempel.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tempel.el b/tempel.el
index ee6e3b546b..8e164e2024 100644
--- a/tempel.el
+++ b/tempel.el
@@ -415,11 +415,12 @@ If INTERACTIVE is nil the function acts like a capf."
:exclusive 'no
:company-kind (lambda (_) 'snippet)
:exit-function
- (lambda (name _status)
- (when-let* ((sym (intern-soft name))
- (template (alist-get sym templates)))
- (delete-region (max (point-min) (- (point) (length name)))
(point))
- (tempel--insert template region)))
+ (lambda (name status)
+ (unless (eq status 'exact)
+ (when-let* ((sym (intern-soft name))
+ (template (alist-get sym templates)))
+ (delete-region (max (point-min) (- (point) (length name)))
(point))
+ (tempel--insert template region))))
:annotation-function
(and tempel-expand-annotation
(apply-partially #'tempel--annotate