mirror of https://github.com/folke/lazy.nvim.git
fix(keys): make sure we don't delete the global mapping when executing an ft keymap. See #1241
This commit is contained in:
parent
ababf0dab5
commit
a9b9a4b3a2
|
@ -163,7 +163,11 @@ end
|
||||||
-- mapping when needed
|
-- mapping when needed
|
||||||
---@param keys LazyKeys
|
---@param keys LazyKeys
|
||||||
function M:_del(keys)
|
function M:_del(keys)
|
||||||
pcall(vim.keymap.del, keys.mode, keys.lhs)
|
pcall(vim.keymap.del, keys.mode, keys.lhs, {
|
||||||
|
-- NOTE: for buffer-local mappings, we only delete the mapping for the current buffer
|
||||||
|
-- So the mapping could still exist in other buffers
|
||||||
|
buffer = keys.ft and true or nil,
|
||||||
|
})
|
||||||
-- make sure to create global mappings when needed
|
-- make sure to create global mappings when needed
|
||||||
-- buffer-local mappings are managed by lazy
|
-- buffer-local mappings are managed by lazy
|
||||||
if not keys.ft then
|
if not keys.ft then
|
||||||
|
|
Loading…
Reference in New Issue