branch: externals/tempel
commit 4d59d0a89f7094d386878562d440f20af295d6d7
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
tempel-complete: Change behavior when triggered without input
---
tempel.el | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tempel.el b/tempel.el
index 01ac7e6a25..25086a7cdb 100644
--- a/tempel.el
+++ b/tempel.el
@@ -715,14 +715,11 @@ Capf, otherwise like an interactive completion command."
(tempel--save)
(unless (completion-at-point)
(user-error "tempel-complete: No matching templates")))
- ;; If Tempel completion is invoked manually, use the marked region for
- ;; template insertion. Insert a trigger prefix if missing. Furthermore
- ;; accept empty input bounds.
- (let* ((manually (eq this-command #'tempel-complete))
- (region (and manually (tempel--region))))
+ ;; Use the marked region for template insertion if triggered manually.
+ (let ((region (and (eq this-command #'tempel-complete) (tempel--region))))
(when-let ((templates (tempel--templates))
(bounds (or (and (not region) (bounds-of-thing-at-point
'symbol))
- (and manually (cons (point) (point))))))
+ (cons (point) (point)))))
(list (car bounds) (cdr bounds) templates
:category 'tempel
:exclusive 'no