fix: from_entry escape and validation (#2058)

This commit is contained in:
Simon Hauser
2022-07-10 21:28:22 +02:00
committed by GitHub
parent 524c4eb7fb
commit 10a3310546
3 changed files with 14 additions and 18 deletions

View File

@@ -12,13 +12,7 @@ local from_entry = {}
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
local path = entry.path
if path == nil then
path = entry.filename
end
@@ -35,7 +29,9 @@ function from_entry.path(entry, validate, escape)
if validate and invalid == 0 then
return
end
if escape then
return vim.fn.fnameescape(path)
end
return path
end