fix(grep): make filename parser non-greedy (#1785)

To protect against content variation including colon / number
combinations
This commit is contained in:
Tom
2022-03-11 09:28:32 +00:00
committed by GitHub
parent 6d5634b477
commit d331433ed8

View File

@@ -112,7 +112,7 @@ do
-- Gets called only once to parse everything out for the vimgrep, after that looks up directly. -- Gets called only once to parse everything out for the vimgrep, after that looks up directly.
local parse = function(t) local parse = function(t)
local _, _, filename, lnum, col, text = string.find(t.value, [[(.+):(%d+):(%d+):(.*)]]) local _, _, filename, lnum, col, text = string.find(t.value, [[(..-):(%d+):(%d+):(.*)]])
local ok local ok
ok, lnum = pcall(tonumber, lnum) ok, lnum = pcall(tonumber, lnum)