summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-05-28 11:36:08 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2021-05-28 11:36:08 +0200
commit3f5f16c83788d003cd69a033b98238ddf9322225 (patch)
treec9e604995007e12691daae5f9c72c9e3fcfaed2d
parent8916edaff52366c5f39925f5e372140476738e1b (diff)
Use 1-
-rw-r--r--corfu.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/corfu.el b/corfu.el
index 714818a..21ac8ea 100644
--- a/corfu.el
+++ b/corfu.el
@@ -540,7 +540,7 @@ Set to nil in order to disable confirmation."
(defun corfu--goto (index)
"Go to candidate with INDEX."
- (setq corfu--index (max -1 (min index (- corfu--total 1)))))
+ (setq corfu--index (max -1 (min index (1- corfu--total)))))
(defun corfu-next ()
"Go to next candidate."
@@ -555,8 +555,8 @@ Set to nil in order to disable confirmation."
(interactive)
(corfu--goto
(if (and corfu-cycle (< corfu--index 0))
- (- corfu--total 1)
- (- corfu--index 1))))
+ (1- corfu--total)
+ (1- corfu--index))))
(defun corfu-scroll-down ()
"Go back by one page."
@@ -576,7 +576,7 @@ Set to nil in order to disable confirmation."
(defun corfu-last ()
"Go to last candidate."
(interactive)
- (corfu--goto (- corfu--total 1)))
+ (corfu--goto (1- corfu--total)))
(defun corfu--restore-on-next-command ()
"Restore window configuration before next command."