* Fixing #2057 * Update change-dir.lua * Fixing error in force_dir_change
This commit is contained in:
@@ -63,12 +63,12 @@ local function add_profiling_to(f)
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.force_dirchange = add_profiling_to(function(foldername, should_open_view)
|
M.force_dirchange = add_profiling_to(function(foldername, should_open_view)
|
||||||
if should_change_dir() then
|
local valid_dir = vim.fn.isdirectory(foldername) == 1 -- prevent problems on non existing dirs
|
||||||
|
if should_change_dir() and valid_dir then
|
||||||
cd(M.options.global, foldername)
|
cd(M.options.global, foldername)
|
||||||
|
core.init(foldername)
|
||||||
end
|
end
|
||||||
|
|
||||||
core.init(foldername)
|
|
||||||
|
|
||||||
if should_open_view then
|
if should_open_view then
|
||||||
require("nvim-tree.lib").open()
|
require("nvim-tree.lib").open()
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user