Fixed: Neotree isn't properly invoked when a directory is given at launch

When a directory is given at lunch through argument e.g. "nvim .", LazyVim opens Neo-tree side window instead of the dashboard. However, the instance isn't fully initialized: if one opens a file directly from Neotree, the tree buffer will be override by that file. And toggling Neotree will then result in error "failed to rename the buffer". Manually toggling Neotree can solve this issue.
This commit is contained in:
mightywilly 2024-04-07 14:39:51 +02:00
parent 97480dc5d2
commit 11727650ea

View file

@ -45,6 +45,7 @@ return {
local stat = vim.uv.fs_stat(vim.fn.argv(0))
if stat and stat.type == "directory" then
require("neo-tree")
vim.cmd("Neotree toggle")
end
end
end,