mirror of
https://github.com/neovim/neovim.git
synced 2026-07-09 19:09:39 +00:00
fix(dir): reload listing on :edit #40496
This commit is contained in:
@@ -195,6 +195,16 @@ function first_open(buf, dir)
|
||||
return
|
||||
end
|
||||
vim.b[buf].nvim_dir = dir
|
||||
api.nvim_create_autocmd('BufReadCmd', {
|
||||
buffer = buf,
|
||||
nested = true,
|
||||
desc = 'Reload directory listing',
|
||||
callback = function()
|
||||
if vim.b[buf].nvim_dir ~= nil then
|
||||
reload(buf)
|
||||
end
|
||||
end,
|
||||
})
|
||||
set_maps(buf)
|
||||
if api.nvim_get_option_value('filetype', { buf = buf }) ~= 'directory' then
|
||||
api.nvim_set_option_value('filetype', 'directory', { buf = buf })
|
||||
|
||||
Reference in New Issue
Block a user