Skip to content

Commit

Permalink
fix: set keybinds for the appropriate buffer (fixes telescope issues)
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jul 13, 2024
1 parent 113c21b commit b49c214
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/neorg/modules/core/keybinds/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local module = modules.create("core.keybinds")
module.load = function()
if module.config.public.default_keybinds then
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
callback = function(ev)
local is_norg = vim.bo.filetype == "norg"

local preset = module.private.presets[module.config.public.preset]
Expand All @@ -24,7 +24,7 @@ module.load = function()
for mode, keybinds in pairs(data) do
for _, keybind in ipairs(keybinds) do
if vim.fn.hasmapto(keybind[2], mode, false) == 0 then
local opts = vim.tbl_deep_extend("force", { buffer = true }, keybinds.opts or {})
local opts = vim.tbl_deep_extend("force", { buffer = ev.buf }, keybinds.opts or {})
vim.keymap.set(mode, keybind[1], keybind[2], opts)
end
end
Expand Down

0 comments on commit b49c214

Please sign in to comment.