diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2022-07-10 21:28:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-10 21:28:22 +0200 |
| commit | 10a3310546284faae4ada397a61d68e0a8d0d9f7 (patch) | |
| tree | 27a6c8dd9c848ecb75d993a7cb7fc683abe3db69 /lua/telescope/from_entry.lua | |
| parent | 524c4eb7fb1a9941460ab7c7c09a3bca9cebb7be (diff) | |
fix: from_entry escape and validation (#2058)
Diffstat (limited to 'lua/telescope/from_entry.lua')
| -rw-r--r-- | lua/telescope/from_entry.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lua/telescope/from_entry.lua b/lua/telescope/from_entry.lua index b608023..f109efb 100644 --- a/lua/telescope/from_entry.lua +++ b/lua/telescope/from_entry.lua @@ -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 |
