branch: externals/capf-autosuggest
commit 0ba985aa1ad236dfa954719dcc281b24402ad48c
Author: jakanakaevangeli <[email protected]>
Commit: jakanakaevangeli <[email protected]>
Minor simplification, use pcase-let
---
capf-autosuggest.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/capf-autosuggest.el b/capf-autosuggest.el
index 4b0e36e..00a7a44 100644
--- a/capf-autosuggest.el
+++ b/capf-autosuggest.el
@@ -99,9 +99,10 @@ point forward."
(if completion-in-region-mode
(capf-autosuggest-active-mode -1)
(when capf-autosuggest-active-mode
- (unless (< (car capf-autosuggest--region) (point)
- (cdr capf-autosuggest--region))
- (capf-autosuggest-active-mode -1)))
+ ;; `identity' is used to generate slightly faster byte-code
+ (pcase-let ((`(,beg . ,end) (identity capf-autosuggest--region)))
+ (unless (< beg (point) end)
+ (capf-autosuggest-active-mode -1))))
(unless capf-autosuggest-active-mode
(pcase (run-hook-wrapped (if capf-autosuggest-capf