emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu 1c646584c3: Do not check the completion predicate


From: ELPA Syncer
Subject: [elpa] externals/corfu 1c646584c3: Do not check the completion predicate on continue commands (Fix #130)
Date: Sat, 19 Feb 2022 22:57:21 -0500 (EST)

branch: externals/corfu
commit 1c646584c3b99480906bf2ec7c4f2440fc4d8800
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Do not check the completion predicate on continue commands (Fix #130)
---
 corfu.el | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/corfu.el b/corfu.el
index 9048714ede..5735f6cfea 100644
--- a/corfu.el
+++ b/corfu.el
@@ -427,12 +427,12 @@ The completion backend can override this with
     ;; XXX HACK We have to apply the face background before adjusting the 
frame parameter,
     ;; otherwise the border is not updated (BUG!).
     (let* ((face (if (facep 'child-frame-border) 'child-frame-border 
'internal-border))
-          (new (face-attribute 'corfu-border :background nil 'default)))
+           (new (face-attribute 'corfu-border :background nil 'default)))
       (unless (equal (face-attribute face :background corfu--frame 'default) 
new)
-       (set-face-background face new corfu--frame)))
+        (set-face-background face new corfu--frame)))
     (let ((new (face-attribute 'corfu-default :background nil 'default)))
       (unless (equal (frame-parameter corfu--frame 'background-color) new)
-       (set-frame-parameter corfu--frame 'background-color new)))
+        (set-frame-parameter corfu--frame 'background-color new)))
     (let ((win (frame-root-window corfu--frame)))
       (set-window-buffer win buffer)
       ;; Mark window as dedicated to prevent frame reuse (#60)
@@ -864,18 +864,23 @@ there hasn't been any input, then quit."
         (`(,beg ,end . ,_)
          (when (let ((pt (point)))
                  (and (eq (marker-buffer beg) (current-buffer))
+                      ;; Check ranges
                       (<= beg pt end)
-                      (or (not corfu--input)
-                          (corfu--match-symbol-p corfu-continue-commands 
this-command)
-                          (< beg end))
                       (save-excursion
                         (goto-char beg)
                         (<= (line-beginning-position) pt (line-end-position)))
-                      (or (and corfu-separator ;; command enables separator 
insertion
-                              (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))))
+                      (or
+                       ;; 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 (and corfu-separator ;; Command enables separator 
insertion
+                                 (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))))))
            (corfu--update)
            t)))
       (corfu-quit)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]