summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Antolín <omar.antolin@gmail.com>2020-04-16 23:51:15 -0500
committerOmar Antolín <omar.antolin@gmail.com>2020-04-16 23:51:15 -0500
commit7f79dc2233947fafb710ae98bc3fa3971f1d9295 (patch)
tree6d8d06f44cd0425480a7220e48b5a7a6496739a3
parent48ec46518ac56193eed4f6318500d767b017e0ab (diff)
Don't move point unless actually completing
-rw-r--r--orderless.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/orderless.el b/orderless.el
index b77a0dc..de21508 100644
--- a/orderless.el
+++ b/orderless.el
@@ -146,11 +146,12 @@ If there are no matches, it returns nil. In any other case it
(let* ((limit (car (completion-boundaries string table pred "")))
(prefix (substring string 0 limit))
(all (orderless-all-completions string table pred point)))
- (cl-flet ((measured (string) (cons string (length string))))
- (cond
- ((null all) nil)
- ((atom (cdr all)) (measured (concat prefix (car all))))
- (t (measured string))))))
+ (cond
+ ((null all) nil)
+ ((atom (cdr all))
+ (let ((full (concat prefix (car all))))
+ (cons full (length full))))
+ (t (cons string point)))))
(cl-pushnew '(orderless
orderless-try-completion orderless-all-completions