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

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

[elpa] externals/urgrep f686c2baa3 051/115: Fix off-by-one error with ma


From: ELPA Syncer
Subject: [elpa] externals/urgrep f686c2baa3 051/115: Fix off-by-one error with matches in Emacs 28; see Emacs bug#49624
Date: Wed, 10 May 2023 03:00:42 -0400 (EDT)

branch: externals/urgrep
commit f686c2baa3c6b4a2bd385a3a4eab1bf6b917d69b
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>

    Fix off-by-one error with matches in Emacs 28; see Emacs bug#49624
---
 urgrep.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/urgrep.el b/urgrep.el
index d9a561bfba..bd6bbca92d 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -557,6 +557,12 @@ If EDIT-COMMAND is non-nil, the search can be edited."
      (1 (if grep-find-abbreviate grep-find-abbreviate-properties
           '(face nil abbreviated-command t))))))
 
+(defvar urgrep--column-end-adjustment
+  (if (< emacs-major-version 28) 0 1)
+  "In Emacs 28+, the column range for matches is closed, but in previous
+versions, it's half-open.  Use this to adjust the value as needed in
+`urgrep--column-end'.")
+
 (defun urgrep--column-begin ()
   "Look forwards for the match highlight to compute the beginning column."
   (let* ((beg (match-end 0))
@@ -573,7 +579,7 @@ If EDIT-COMMAND is non-nil, the search can be edited."
          (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil
                                                       end))))
     (when mend
-      (- mend beg))))
+      (- mend beg urgrep--column-end-adjustment))))
 
 (defun urgrep--grouped-filename ()
   "Look backwards for the filename when a match is found in grouped output."



reply via email to

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