Skip to content

Commit

Permalink
fix(previewer): don't escape paths for fs_stat (#2996)
Browse files Browse the repository at this point in the history
`vim.loop.fs_stat` takes file paths literally so no escaping special
characters are need (eg spaces, `$`, etc)

(cherry picked from commit 221778e)
  • Loading branch information
jamestrew authored and Conni2461 committed May 20, 2024
1 parent d5fe96e commit ce398bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lua/telescope/previewers/buffer_previewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ previewers.cat = defaulter(function(opts)
end,

get_buffer_by_name = function(_, entry)
return from_entry.path(entry, false)
return from_entry.path(entry, false, false)
end,

define_preview = function(self, entry, status)
local p = from_entry.path(entry, true)
local p = from_entry.path(entry, true, false)
if p == nil or p == "" then
return
end
Expand Down Expand Up @@ -465,7 +465,7 @@ previewers.vimgrep = defaulter(function(opts)
end,

get_buffer_by_name = function(_, entry)
return from_entry.path(entry, false)
return from_entry.path(entry, false, false)
end,

define_preview = function(self, entry, status)
Expand All @@ -476,7 +476,7 @@ previewers.vimgrep = defaulter(function(opts)
or false
local p
if not has_buftype then
p = from_entry.path(entry, true)
p = from_entry.path(entry, true, false)
if p == nil or p == "" then
return
end
Expand Down Expand Up @@ -889,7 +889,7 @@ previewers.git_file_diff = defaulter(function(opts)

define_preview = function(self, entry, status)
if entry.status and (entry.status == "??" or entry.status == "A ") then
local p = from_entry.path(entry, true)
local p = from_entry.path(entry, true, false)
if p == nil or p == "" then
return
end
Expand Down

0 comments on commit ce398bc

Please sign in to comment.