[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-numbers 1bf577af5c 132/145: Fix #26: Optionally match
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-numbers 1bf577af5c 132/145: Fix #26: Optionally match characters directly before the cursor |
Date: |
Thu, 6 Jan 2022 03:00:25 -0500 (EST) |
branch: elpa/evil-numbers
commit 1bf577af5c6622741aca0f92a629d6dfad172917
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Fix #26: Optionally match characters directly before the cursor
---
CHANGELOG.org | 7 +++++++
README.org | 5 +++++
evil-numbers.el | 23 +++++++++++++++++------
3 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index 1805b9be51..5603599136 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -1,5 +1,12 @@
#+TITLE: Evil Numbers CHANGELOG
+* in development
+
+** Additions
+
+ + =evil-numbers-use-cursor-at-end-of-number= option to match numbers
directly before the cursor
+ (diverging from VIM's default behavior).
+
* 0.6
** Additions
diff --git a/README.org b/README.org
index 65878c7062..aa7675e15c 100644
--- a/README.org
+++ b/README.org
@@ -47,6 +47,11 @@
- '=upcase= Always upper case.
- '=downcase= Always lower case.
+ - =evil-numbers-use-cursor-at-end-of-number= ::
+ Support matching numbers directly before the cursor.
+
+ This is off by default this is not done as it doesn't match VIM's default
behavior.
+
** Key Bindings
Example key bindings:
diff --git a/evil-numbers.el b/evil-numbers.el
index 94ac8225dd..6997b6789d 100644
--- a/evil-numbers.el
+++ b/evil-numbers.el
@@ -99,6 +99,13 @@ Otherwise nil will disable this functionality."
(const :tag "Upper Case" upcase)
(const :tag "Lower Case" downcase)))
+(defcustom evil-numbers-use-cursor-at-end-of-number nil
+ "When non-nil, recognize numbers directly before the cursor.
+
+This doesn't match VIM's behavior."
+ :group 'evil-numbers
+ :type 'boolean
+ :options '(nil t))
;; ---------------------------------------------------------------------------
;; Internal Variables
@@ -601,12 +608,16 @@ result in a number with a + sign."
(t
(let ((point-next
(save-excursion
- ;; `forward-char' so that we do not match the number
- ;; directly behind us.
- ;;
- ;; Check the range to avoid end-of-buffer warning or skipping to
the next line.
- (unless (>= (1+ (point)) (point-at-eol))
- (forward-char))
+ ;; While the default (nil) is VIM's default behavior,
+ ;; users may want to change this, see: #26.
+ (unless evil-numbers-use-cursor-at-end-of-number
+ ;; `forward-char' so that we do not match the number
+ ;; directly behind us.
+ ;;
+ ;; Check the range to avoid end-of-buffer warning
+ ;; or skipping to the next line.
+ (unless (>= (1+ (point)) (point-at-eol))
+ (forward-char)))
(when (evil-numbers--inc-at-pt-impl-with-search
amount (point-at-bol) (point-at-eol) padded)
(point)))))
- [nongnu] elpa/evil-numbers d09a0e676a 125/145: Fix #25 increment steps to the next line, (continued)
- [nongnu] elpa/evil-numbers d09a0e676a 125/145: Fix #25 increment steps to the next line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 08f0c1ee93 145/145: Cleanup: warnings for tests, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers e1b60f3b75 133/145: Fix #27 Number directly before the cursor manipulated in some cases, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 3bd94723f8 134/145: Cleanup: indentation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 0d66b63f42 116/145: CHANGELOG.org: update with recent fixes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 1acf90638b 128/145: Bump to 0.6, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers c39f8f1c19 122/145: Cleanup: auto-indent the changelog, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers ef72a4fea1 135/145: Cleanup: correct doc-strings, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 70b986276a 117/145: Cleanup: declare nums as `(list)` for readability, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 623bcbd04f 130/145: README: add "similar packages" section, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 1bf577af5c 132/145: Fix #26: Optionally match characters directly before the cursor,
ELPA Syncer <=
- [nongnu] elpa/evil-numbers 43ae06047c 115/145: README.org: keypad can be used for other platforms too, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 83e98f9fe2 096/145: Correct invalid limit argument to `looking-back', ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers a6cf01fd90 090/145: Fix #21 increment w/ selection ignores items before the cursor, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 11fc45c760 086/145: Cleanup: move subscript encode/decode into utility functions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers bea0c102af 088/145: Cleanup: use term amount for both decimal/(hex/bin/octal) functions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers f33d0137ac 072/145: Cleanup: quiet package-lint warnings, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 48b528baec 131/145: Refactor: instead of passing an amount, pass in a function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers fd742943fd 127/145: README.org use definition lists for options, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers cd23a7b458 136/145: README.org: update poor wording, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-numbers 9841266544 113/145: Cleanup: replace catch/throw with a 'found' variable, ELPA Syncer, 2022/01/06