summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorLuke Kershaw <35707277+l-kershaw@users.noreply.github.com>2022-01-16 15:54:51 +0000
committerGitHub <noreply@github.com>2022-01-16 16:54:51 +0100
commitc1b9dab30030820999145ee6292fce7dc092c4fe (patch)
tree90eb71be8a61987a039a18d4b4389209ed0c6136 /lua
parent2bfc0eb2cf12237eb0ac15498229341ededfaa0d (diff)
fix: handle filenames with colons in `live_grep` (#1609)
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/make_entry.lua22
1 files changed, 1 insertions, 21 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index 98129d7..e3d7638 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -110,29 +110,9 @@ do
ordinal = 1,
}
- local find = (function()
- if Path.path.sep == "\\" then
- return function(t)
- local start, _, filename, lnum, col, text = string.find(t, [[([^:]+):(%d+):(%d+):(.*)]])
-
- -- Handle Windows drive letter (e.g. "C:") at the beginning (if present)
- if start == 3 then
- filename = string.sub(t.value, 1, 3) .. filename
- end
-
- return filename, lnum, col, text
- end
- else
- return function(t)
- local _, _, filename, lnum, col, text = string.find(t, [[([^:]+):(%d+):(%d+):(.*)]])
- return filename, lnum, col, text
- end
- end
- end)()
-
-- Gets called only once to parse everything out for the vimgrep, after that looks up directly.
local parse = function(t)
- local filename, lnum, col, text = find(t.value)
+ local _, _, filename, lnum, col, text = string.find(t.value, [[(.+):(%d+):(%d+):(.*)]])
local ok
ok, lnum = pcall(tonumber, lnum)