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

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

[nongnu] elpa/evil-numbers 83e98f9fe2 096/145: Correct invalid limit arg


From: ELPA Syncer
Subject: [nongnu] elpa/evil-numbers 83e98f9fe2 096/145: Correct invalid limit argument to `looking-back'
Date: Thu, 6 Jan 2022 03:00:22 -0500 (EST)

branch: elpa/evil-numbers
commit 83e98f9fe229efe2fd414270e84916bbea2aa8b5
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Correct invalid limit argument to `looking-back'
    
    This argument is an absolute position,
    not relative to the point.
    
    Also apply limit to skip-chars-forward.
---
 evil-numbers.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/evil-numbers.el b/evil-numbers.el
index ab7b7c9e40..97dd9d3399 100644
--- a/evil-numbers.el
+++ b/evil-numbers.el
@@ -348,10 +348,10 @@ note that searching still starts at POINT."
     (or
      (not (memq (char-after) '(?b ?B ?o ?O ?x ?X)))
      (/= (char-before) ?0)
-     (and (> (point) 2) ;; Should also take bofp into consideration.
-          (not (looking-back "\\W0" 2)))
+     ;; Should also take bofp into consideration.
+     (not (looking-back "\\W0" (max beg (- (point) 2))))
      ;; Skip format specifiers and interpret as boolean.
-     (<= 0 (skip-chars-forward "bBoOxX"))))))
+     (<= 0 (skip-chars-forward "bBoOxX" end))))))
 
 (defun evil-numbers--match-from-skip-chars (skip-chars dir do-check do-match)
   "Match SKIP-CHARS in DIR (-1 or 1).



reply via email to

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