summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxeluxee <[email protected]>2021-12-04 16:57:41 +0100
committerGitHub <[email protected]>2021-12-04 16:57:41 +0100
commit02a1e769be9139dfe7294d24b7be2d09bb30b77f (patch)
treee9431bb72e7d5dba17b689220ce07b5b4b42bc33
parentef5ca00df50b7d7ece7a794bcfe8a3bd7d37720d (diff)
fix(nvimtree): handle paths containing spaces (#2027)
-rw-r--r--lua/lvim/core/nvimtree.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/lvim/core/nvimtree.lua b/lua/lvim/core/nvimtree.lua
index 05945059..cb91e344 100644
--- a/lua/lvim/core/nvimtree.lua
+++ b/lua/lvim/core/nvimtree.lua
@@ -170,9 +170,11 @@ end
function M.start_telescope(telescope_mode)
local node = require("nvim-tree.lib").get_node_at_cursor()
local abspath = node.link_to or node.absolute_path
- local is_folder = node.has_children and true
+ local is_folder = node.open ~= nil
local basedir = is_folder and abspath or vim.fn.fnamemodify(abspath, ":h")
- vim.api.nvim_command("Telescope " .. telescope_mode .. " cwd=" .. basedir)
+ require("telescope.builtin")[telescope_mode] {
+ cwd = basedir,
+ }
end
return M