Skip to content

Commit 4e4d93a

Browse files
fix(mappings): Keep track of fallback <CR> only from other plugins
1 parent 6fb7a62 commit 4e4d93a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/orgmode/config/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ end
212212
---@see orgmode.config.mappings
213213
function Config:setup_mappings(category, buffer)
214214
if category == 'org' and vim.bo.filetype == 'org' and not vim.b[buffer].org_old_cr_mapping then
215-
vim.b[buffer].org_old_cr_mapping = utils.get_keymap({
215+
local old_mapping = utils.get_keymap({
216216
mode = 'i',
217217
lhs = '<CR>',
218218
buffer = buffer,
219219
})
220+
if old_mapping and old_mapping.rhs ~= '<Cmd>lua require("orgmode").action("org_mappings.org_return")<CR>' then
221+
vim.b[buffer].org_old_cr_mapping = old_mapping
222+
end
220223
end
221224
local maps = self:get_mappings(category, buffer)
222225
if not maps then

0 commit comments

Comments
 (0)