[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-numbers b2397f278a 094/145: Cleanup: move forward cha
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-numbers b2397f278a 094/145: Cleanup: move forward character check in evil-numbers--search-number |
Date: |
Thu, 6 Jan 2022 03:00:21 -0500 (EST) |
branch: elpa/evil-numbers
commit b2397f278a6ad0cf4879440855fcd5d10f09206f
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Cleanup: move forward character check in evil-numbers--search-number
This check relates to an implementation detail of how looking-back works,
the caller should not have to be aware of this.
---
evil-numbers.el | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/evil-numbers.el b/evil-numbers.el
index 7da0ef82eb..22a3bab989 100644
--- a/evil-numbers.el
+++ b/evil-numbers.el
@@ -204,17 +204,6 @@ NO-OFFSET don't apply offsets, expected for VIM like
behavior.
(let ((point-next nil))
(save-excursion
(save-match-data
-
- (unless no-offset
- ;; `forward-char' so that we do not match the number
- ;; directly behind us.
- ;;
- ;; Check the range to avoid end-of-buffer warning.
- ;; Harmless but happens with block selection every
- ;; time which is unreasonably noisy.
- (unless (>= (1+ (point)) (point-max))
- (forward-char)))
-
(cond
((not (evil-numbers--search-number
(or beg (point-at-bol))
@@ -334,14 +323,24 @@ note that searching still starts at POINT."
(or
;; Numbers or format specifier in front.
(and (> (point) beg)
- (looking-back
- (rx (or (+? digit)
- (in "⁰¹²³⁴⁵⁶⁷⁸⁹")
- (in "₀₁₂₃₄₅₆₇₈₉" )
- (and "0" (or (and (in "bB") (*? (in "01")))
- (and (in "oO") (*? (in "0-7")))
- (and (in "xX") (*? (in digit "A-Fa-f")))))))
- beg))
+ (save-excursion
+ ;; `forward-char' so that we do not match the number
+ ;; directly behind us.
+ ;;
+ ;; Check the range to avoid end-of-buffer warning.
+ ;; Harmless but happens with block selection every
+ ;; time which is unreasonably noisy.
+ (unless (>= (1+ (point)) (point-max))
+ (forward-char))
+ (looking-back
+ (rx (or (+? digit)
+ (in "⁰¹²³⁴⁵⁶⁷⁸⁹")
+ (in "₀₁₂₃₄₅₆₇₈₉" )
+ (and "0"
+ (or (and (in "bB") (*? (in "01")))
+ (and (in "oO") (*? (in "0-7")))
+ (and (in "xX") (*? (in digit "A-Fa-f")))))))
+ beg)))
;; Search for number in rest of line match 0 of specifier or digit,
;; being in a literal and after specifier is handled above.
(and
- [nongnu] elpa/evil-numbers b754f53c82 039/145: support for increasing superscripts, (continued)
- [nongnu] elpa/evil-numbers b754f53c82 039/145: support for increasing superscripts, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers fb16206158 054/145: Fix autoloading, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 4308935a03 061/145: Resolve looking-back warnings, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers aa94cd1b26 063/145: Merge pull request #11 from ideasman42/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 5356111930 077/145: Cleanup: avoid let binding to set default values for arguments, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers b54cc5ba35 076/145: Fix spelling, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers c37a4cf92a 092/145: Fix padding being ignored with block selection, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers e8dfba58c9 081/145: Cleanup: split skip characters matching out into a function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 7602f3b484 101/145: Cleanup: split number incrementing into it's own function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 3fe56219af 091/145: Cleanup: docstring, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers b2397f278a 094/145: Cleanup: move forward character check in evil-numbers--search-number,
ELPA Syncer <=
- [nongnu] elpa/evil-numbers 6093a5e039 085/145: Cleanup: use identity functions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers b98a3dccd3 104/145: Cleanup: forward limits to evil-numbers--search-and-replace, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers cb9eb99998 141/145: Tests: add simple-nop-non-number-with-newline-after test, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 29859e64c0 138/145: Add automated tests, resolve #22, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 95fd1faf90 006/145: Use `while' instead of `do'., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers b84ee09de1 012/145: Fix license., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 83b2ad44ff 010/145: Use lowercase and uppercase example., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers bd2359c96f 003/145: Fix provide., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 2301d66203 009/145: Fix docstrings of inc and dec., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 88de7e9622 007/145: Extract number search., ELPA Syncer, 2022/01/06