[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/avy 509471bad0 19/31: avy.el (avy-text): Store the avy-
From: |
ELPA Syncer |
Subject: |
[elpa] externals/avy 509471bad0 19/31: avy.el (avy-text): Store the avy-goto-char-timer text |
Date: |
Mon, 13 Feb 2023 21:57:27 -0500 (EST) |
branch: externals/avy
commit 509471bad0e8094b8639729ec39ca141fae7d4bd
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
avy.el (avy-text): Store the avy-goto-char-timer text
Fixes #303
---
avy.el | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/avy.el b/avy.el
index fd6131627c..fe539cb09e 100644
--- a/avy.el
+++ b/avy.el
@@ -2028,6 +2028,9 @@ newline."
"Whether enter exits avy-goto-char-timer early. If nil it matches newline"
:type 'boolean)
+(defvar avy-text ""
+ "Store the input read by `avy--read-candidates'.")
+
(defun avy--read-candidates (&optional re-builder)
"Read as many chars as possible and return their occurrences.
At least one char must be read, and then repeatedly one next char
@@ -2041,8 +2044,8 @@ RE-BUILDER is a function that takes a string and returns
a regex.
When nil, `regexp-quote' is used.
If a group is captured, the first group is highlighted.
Otherwise, the whole regex is highlighted."
- (let ((str "")
- (re-builder (or re-builder #'regexp-quote))
+ (setq avy-text "")
+ (let ((re-builder (or re-builder #'regexp-quote))
char break overlays regex)
(unwind-protect
(progn
@@ -2052,11 +2055,11 @@ Otherwise, the whole regex is highlighted."
(setq char
(read-char (format "%d char%s: "
(length overlays)
- (if (string= str "")
- str
- (format " (%s)" str)))
+ (if (string= avy-text "")
+ avy-text
+ (format " (%s)" avy-text)))
t
- (and (not (string= str ""))
+ (and (not (string= avy-text ""))
avy-timeout-seconds))))
;; Unhighlight
(dolist (ov overlays)
@@ -2067,21 +2070,21 @@ Otherwise, the whole regex is highlighted."
((= char 13)
(if avy-enter-times-out
(setq break t)
- (setq str (concat str (list ?\n)))))
+ (setq avy-text (concat avy-text (list ?\n)))))
;; Handle C-h, DEL
((memq char avy-del-last-char-by)
- (let ((l (length str)))
+ (let ((l (length avy-text)))
(when (>= l 1)
- (setq str (substring str 0 (1- l))))))
+ (setq avy-text (substring avy-text 0 (1- l))))))
;; Handle ESC
((= char 27)
(keyboard-quit))
(t
- (setq str (concat str (list char)))))
+ (setq avy-text (concat avy-text (list char)))))
;; Highlight
- (when (>= (length str) 1)
+ (when (>= (length avy-text) 1)
(let ((case-fold-search
- (or avy-case-fold-search (string= str (downcase str))))
+ (or avy-case-fold-search (string= avy-text (downcase
avy-text))))
found)
(avy-dowindows current-prefix-arg
(dolist (pair (avy--find-visible-regions
@@ -2089,7 +2092,7 @@ Otherwise, the whole regex is highlighted."
(window-end (selected-window) t)))
(save-excursion
(goto-char (car pair))
- (setq regex (funcall re-builder str))
+ (setq regex (funcall re-builder avy-text))
(while (re-search-forward regex (cdr pair) t)
(unless (not (avy--visible-p (1- (point))))
(let* ((idx (if (= (length (match-data)) 4) 1 0))
- [elpa] externals/avy updated (c4adda8ca5 -> 9b1f0bc427), ELPA Syncer, 2023/02/13
- [elpa] externals/avy 5f2eba5f59 12/31: avy.el (avy-isearch): Bind avy-case-fold-search to case-fold-search, ELPA Syncer, 2023/02/13
- [elpa] externals/avy f9c15c573c 14/31: Fix subword commands with custom order., ELPA Syncer, 2023/02/13
- [elpa] externals/avy 455ebec6f3 11/31: avy.el (avy-process): Amend last commit for avy-goto-char-timer, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 034de4c0e9 09/31: avy.el: Add -above and -below versions of avy-goto-whitespace-end, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 01a311ca6a 07/31: avy.el: Get rid of magic char numbers, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 509471bad0 19/31: avy.el (avy-text): Store the avy-goto-char-timer text,
ELPA Syncer <=
- [elpa] externals/avy bbf1e7339e 24/31: avy.el (avy-order-closest): Work with avy-goto-line, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 9ae059deaa 04/31: .github/FUNDING.yml: Add, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 343fc42de1 05/31: avy.el (avy-process): Return nil on "C-g" and "ESC", ELPA Syncer, 2023/02/13
- [elpa] externals/avy f91ae613a8 02/31: avy.el (avy-goto-line): Call avy-action-goto only when avy-action is not set, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 87394c9a88 13/31: avy.el (avy-isearch): Return relevant result, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 5127f993f9 10/31: avy.el (avy-process): Restart on fail for avy-style 'words, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 66886e265c 06/31: avy.el (avy-read): Don't call `avy--key-to-char' too early, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 8686845ed9 01/31: avy.el (avy-flyspell-correct-function): Add, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 27d1af3fa6 08/31: avy.el (avy-goto-whitespace-end): New command, ELPA Syncer, 2023/02/13
- [elpa] externals/avy cf95ba9582 15/31: avy.el (avy-with): Fix typo in doc-string, ELPA Syncer, 2023/02/13