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

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

[elpa] externals/capf-autosuggest f137fcb 39/63: Fix previous-matching-i


From: ELPA Syncer
Subject: [elpa] externals/capf-autosuggest f137fcb 39/63: Fix previous-matching-input if point isn't touching overlay
Date: Wed, 27 Oct 2021 14:58:00 -0400 (EDT)

branch: externals/capf-autosuggest
commit f137fcbe9705012006850c644e5e29854ad58fa5
Author: jakanakaevangeli <jakanakaevangeli@chiru.no>
Commit: jakanakaevangeli <jakanakaevangeli@chiru.no>

    Fix previous-matching-input if point isn't touching overlay
---
 capf-autosuggest.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/capf-autosuggest.el b/capf-autosuggest.el
index fd0d293..390b8a7 100644
--- a/capf-autosuggest.el
+++ b/capf-autosuggest.el
@@ -301,24 +301,28 @@ inactive."
 
 (defun capf-autosuggest-comint-previous-matching-input-from-input (n)
   "Like `comint-previous-matching-input-from-input'.
-But increase arument N by 1, if positive, but not on command
-repetition."
+If N is positive, the command isn't repeated and point is at
+auto-suggested overlay, increase argument N by 1.  This is done
+in order to skip the history element already shown by the overlay."
   (interactive "p")
   (and (not (memq last-command '(comint-previous-matching-input-from-input
                                  comint-next-matching-input-from-input)))
        (> n 0)
+       (= (point) (overlay-start capf-autosuggest--overlay))
        (setq n (1+ n)))
   (comint-previous-matching-input-from-input n)
   (setq this-command #'comint-previous-matching-input-from-input))
 
 (defun capf-autosuggest-eshell-previous-matching-input-from-input (n)
   "Like `eshell-previous-matching-input-from-input'.
-But increase arument N by 1, if positive, but not on command
-repetition."
+If N is positive, the command isn't repeated and point is at
+auto-suggested overlay, increase argument N by 1.  This is done
+in order to skip the history element already shown by the overlay."
   (interactive "p")
   (and (not (memq last-command '(eshell-previous-matching-input-from-input
                                  eshell-next-matching-input-from-input)))
        (> n 0)
+       (= (point) (overlay-start capf-autosuggest--overlay))
        (setq n (1+ n)))
   (eshell-previous-matching-input-from-input n)
   (setq this-command #'eshell-previous-matching-input-from-input))



reply via email to

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