Skip to content

Commit

Permalink
Be less restrictive with matching ':' in file names (#146)
Browse files Browse the repository at this point in the history
This is causing troubles with line:column like patterns in files
gaining traction from ipv6 adoption. Let's just parse the filename up
until the first ':' here to improve the situation.
  • Loading branch information
dajva committed Nov 17, 2022
1 parent 3880e8c commit 14d4c6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rg-result.el
Expand Up @@ -478,7 +478,7 @@ This function is called from `compilation-filter-hook'."
;; The regexp and filter functions below were taken from ag.el
;; Kudos to the people from https://github.com/Wilfred/ag.el for these.
(defconst rg-file-line-column-pattern-nogroup
"^\\(.+?\\):\\([1-9][0-9]*\\):\\([1-9][0-9]*\\):"
"^\\([^\n:]+?\\):\\([1-9][0-9]*\\):\\([1-9][0-9]*\\):"
"A regexp pattern that groups output.
Groups into filename,line number and column number.")

Expand All @@ -492,7 +492,7 @@ Groups into filename,line number and column number.")
rg-align-position-content-separator) ":"))))

(defconst rg-file-line-pattern-nogroup
"^\\(.+?\\):\\([1-9][0-9]*\\):"
"^\\([^\n:]+?\\):\\([1-9][0-9]*\\):"
"A regexp pattern that groups output into filename, line number.")

(defun rg-file-line-pattern-group ()
Expand Down

0 comments on commit 14d4c6a

Please sign in to comment.