mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
refactor: cleanup
This commit is contained in:
parent
008de2c10e
commit
1ad5b0e016
1 changed files with 1 additions and 2 deletions
|
|
@ -46,15 +46,14 @@ return {
|
||||||
vim.api.nvim_create_autocmd("BufEnter", {
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
|
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
|
||||||
desc = "Start Neo-tree with directory",
|
desc = "Start Neo-tree with directory",
|
||||||
|
once = true,
|
||||||
callback = function()
|
callback = function()
|
||||||
if package.loaded["neo-tree"] then
|
if package.loaded["neo-tree"] then
|
||||||
vim.api.nvim_del_augroup_by_name("Neotree_start_directory")
|
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
local stats = vim.uv.fs_stat(vim.fn.argv(0))
|
local stats = vim.uv.fs_stat(vim.fn.argv(0))
|
||||||
if stats and stats.type == "directory" then
|
if stats and stats.type == "directory" then
|
||||||
require("neo-tree")
|
require("neo-tree")
|
||||||
vim.api.nvim_del_augroup_by_name("Neotree_start_directory")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue