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

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

[elpa] externals/urgrep dc5438102f: Fix an edge case in filtering ANSI e


From: ELPA Syncer
Subject: [elpa] externals/urgrep dc5438102f: Fix an edge case in filtering ANSI escapes
Date: Tue, 30 Jul 2024 00:59:16 -0400 (EDT)

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

    Fix an edge case in filtering ANSI escapes
    
    Previously, if the last character in the buffer was "\033", we'd get 
confused
    and move past the almost-certainly incomplete escape sequence.
---
 urgrep.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/urgrep.el b/urgrep.el
index 7ad734bc08..26a4c0d894 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -1057,7 +1057,8 @@ This function is called from `compilation-filter-hook'."
         (goto-char urgrep--filter-start)
         (catch 'done
           (while (search-forward "\033" end 'limit)
-            (when (eq (char-after) ?\[)
+            (when (or (eq (point) (point-max))
+                      (eq (char-after) ?\[))
               (backward-char)
               (unless (looking-at (rx ansi-any-cseq))
                 ;; This control sequence is incomplete.  Try again next time.
@@ -1114,7 +1115,7 @@ This function is called from `compilation-filter-hook'."
                     (delete-region cseq-begin match-begin))))
                ;; If nothing matched, just proceed forward.
                (t (forward-char))))))
-            (setq urgrep--filter-start (point))))))
+        (setq urgrep--filter-start (point))))))
 
 (defun urgrep-outline-search (&optional bound move backward looking-at)
   "Search for outline headings.  See `outline-search-function'."



reply via email to

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