[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 285fdd70c0 3/3: Minor cleanup
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 285fdd70c0 3/3: Minor cleanup |
Date: |
Fri, 14 Oct 2022 04:57:25 -0400 (EDT) |
branch: externals/corfu
commit 285fdd70c05b2d38c73f0998477d51e7a5360336
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Minor cleanup
---
corfu.el | 55 ++++++++++++++++++++++++++-----------------------------
1 file changed, 26 insertions(+), 29 deletions(-)
diff --git a/corfu.el b/corfu.el
index 4ec7051c51..7c6e414b9a 100644
--- a/corfu.el
+++ b/corfu.el
@@ -912,35 +912,32 @@ See `corfu-separator' for more details."
(defun corfu--continue-p ()
"Continue completion?"
- (pcase completion-in-region--data
- (`(,beg ,end . ,_)
- (and (eq (marker-buffer beg) (current-buffer))
- ;; Check ranges
- (let ((pt (point)))
- (and (<= beg pt end)
- (save-excursion
- (goto-char beg)
- (let ((inhibit-field-text-motion t))
- (<= (line-beginning-position) pt
(line-end-position))))))
- (or
- ;; TODO We keep alive Corfu if a `overriding-terminal-local-map'
is
- ;; installed, for example the `universal-argument-map'. It would
be good to
- ;; think about a better criterion instead. Unfortunately relying
on
- ;; `this-command' alone is not sufficient, since the value of
`this-command'
- ;; gets clobbered in the case of transient keymaps.
- overriding-terminal-local-map
- ;; Check if it is an explicitly listed continue command
- (corfu--match-symbol-p corfu-continue-commands this-command)
- (and
- ;; Check for empty input
- (or (not corfu--input) (< beg end))
- ;; Check separator or predicate
- (or (not corfu-quit-at-boundary)
- (and (eq corfu-quit-at-boundary 'separator)
- (or (eq this-command #'corfu-insert-separator)
- ;; with separator, any further chars allowed
- (seq-contains-p (car corfu--input)
corfu-separator)))
- (funcall completion-in-region-mode--predicate))))))))
+ (pcase-let ((pt (point))
+ (`(,beg ,end . ,_) completion-in-region--data))
+ (and beg end
+ (eq (marker-buffer beg) (current-buffer))
+ ;; Check ranges
+ (<= beg pt end)
+ (save-excursion
+ (goto-char beg)
+ (let ((inhibit-field-text-motion t))
+ (<= (line-beginning-position) pt (line-end-position))))
+ (or
+ ;; TODO We keep alive Corfu if a `overriding-terminal-local-map' is
+ ;; installed, for example the `universal-argument-map'. It would be
good to
+ ;; think about a better criterion instead. Unfortunately relying on
+ ;; `this-command' alone is not sufficient, since the value of
`this-command'
+ ;; gets clobbered in the case of transient keymaps.
+ overriding-terminal-local-map
+ ;; Check if it is an explicitly listed continue command
+ (corfu--match-symbol-p corfu-continue-commands this-command)
+ (and (or (not corfu--input) (< beg end)) ;; Check for empty input
+ (or (not corfu-quit-at-boundary) ;; Check separator or predicate
+ (and (eq corfu-quit-at-boundary 'separator)
+ (or (eq this-command #'corfu-insert-separator)
+ ;; with separator, any further chars allowed
+ (seq-contains-p (car corfu--input)
corfu-separator)))
+ (funcall completion-in-region-mode--predicate)))))))
(defun corfu--post-command ()
"Refresh Corfu after last command."