Skip to content

Commit

Permalink
Somehow this breaks things (specifically my cmp mapping), so TBD why.
Browse files Browse the repository at this point in the history
Revert "Another minor tweak to cleaning up our abbreviations mappings."

This reverts commit 1b44c09.
  • Loading branch information
Julian committed Oct 16, 2024
1 parent 273749f commit a1b7879
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lua/lean/abbreviations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,19 @@ local function insert_char_pre()
end
end)

for key in vim.iter(mappings) do
local current = vim.fn.maparg(key, 'i', false, true)
if current.buffer then
cleanups[key] = function()
vim.fn.mapset(current)
for imap in vim.iter(vim.api.nvim_buf_get_keymap(0, 'i')) do
local lhs = imap.lhs
local rhs = imap.rhs or ''
if mappings[lhs] then
cleanups[lhs] = function()
vim.api.nvim_buf_set_keymap(0, 'i', lhs, rhs, {
nowait = imap.nowait,
silent = imap.silent,
script = imap.script,
expr = imap.expr,
unique = imap.unique,
callback = imap.callback,
})
end
end
end
Expand Down

0 comments on commit a1b7879

Please sign in to comment.