From f8047b8bc9e2fdc06cc3b5d3d7701f1299f3b6e4 Mon Sep 17 00:00:00 2001 From: Fabian David Schmidt <39233597+fdschmidt93@users.noreply.github.com> Date: Sun, 3 Jul 2022 21:26:45 +0300 Subject: [PATCH] fix(from_entry): treat directories as valid paths (#2035) --- lua/telescope/from_entry.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/telescope/from_entry.lua b/lua/telescope/from_entry.lua index 83e5aca..b608023 100644 --- a/lua/telescope/from_entry.lua +++ b/lua/telescope/from_entry.lua @@ -30,7 +30,9 @@ function from_entry.path(entry, validate, escape) return end - if validate and vim.fn.filereadable(path) == 0 then + -- only 0 if neither filereadable nor directory + local invalid = vim.fn.filereadable(path) + vim.fn.isdirectory(path) + if validate and invalid == 0 then return end