fix(dir): user/plugin can override default "-" mapping #40676

This commit is contained in:
Barrett Ruth
2026-07-10 10:52:24 -05:00
committed by GitHub
parent 6a8bb2d62f
commit 20a4b1bc5e
3 changed files with 18 additions and 13 deletions

View File

@@ -18,6 +18,10 @@ vim.keymap.set('n', '<Plug>(nvim-dir-reload)', function()
require('nvim.dir')._reload()
end, { silent = true, desc = 'Reload directory' })
if vim.fn.mapcheck('-', 'n') == '' and vim.fn.hasmapto('<Plug>(nvim-dir-up)', 'n') == 0 then
vim.keymap.set('n', '-', '<Plug>(nvim-dir-up)', { silent = true, desc = 'Open parent directory' })
end
---@param buf integer
---@param path string
---@return boolean