fix(dir): preserve alternate file #41177

This commit is contained in:
Barrett Ruth
2026-08-05 12:36:58 -05:00
committed by GitHub
parent e2c0c63452
commit 9127ed41a5
4 changed files with 24 additions and 1 deletions

View File

@@ -12,7 +12,12 @@ end, { silent = true, desc = 'Open directory entry' })
vim.keymap.set('n', '<Plug>(nvim-dir-up)', function()
if vim.v.count == 1 then
api.nvim_cmd({ cmd = 'edit', args = { '.' }, magic = { file = false, bar = false } }, {})
api.nvim_cmd({
cmd = 'edit',
args = { '.' },
mods = { keepalt = vim.b.nvim_dir ~= nil },
magic = { file = false, bar = false },
}, {})
return
end
local dir = require('nvim.dir')