diff options
| author | Daniel Imfeld <daniel@imfeld.dev> | 2022-03-06 09:34:44 -1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-06 20:34:44 +0100 |
| commit | b501d9ecb7d8181e2238620c919740025e8b2096 (patch) | |
| tree | 1f9c8d4f2d67e751ed5c51282c06b91bf2f37d8e /lua | |
| parent | 1ebf53d8db12ee500d87907ae520d0115fad5181 (diff) | |
fix: skip path escaping when adding items to quickfix list (#1712)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/actions/init.lua | 2 | ||||
| -rw-r--r-- | lua/telescope/from_entry.lua | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index f811a92..b0a316e 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -623,7 +623,7 @@ local entry_to_qf = function(entry) return { bufnr = entry.bufnr, - filename = from_entry.path(entry, false), + filename = from_entry.path(entry, false, false), lnum = vim.F.if_nil(entry.lnum, 1), col = vim.F.if_nil(entry.col, 1), text = text, diff --git a/lua/telescope/from_entry.lua b/lua/telescope/from_entry.lua index 937f11f..219d114 100644 --- a/lua/telescope/from_entry.lua +++ b/lua/telescope/from_entry.lua @@ -10,8 +10,15 @@ This will provide standard mechanism for accessing information from an entry. local from_entry = {} -function from_entry.path(entry, validate) - local path = entry.path and vim.fn.fnameescape(entry.path) or nil +function from_entry.path(entry, validate, escape) + escape = vim.F.if_nil(escape, true) + local path + if escape then + path = entry.path and vim.fn.fnameescape(entry.path) or nil + else + path = entry.path + end + if path == nil then path = entry.filename end |
