Skip to content

Commit 16cf859

Browse files
fix(Enter): Return early if mapping callback returns nil
Should address #799
1 parent 0683da9 commit 16cf859

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/orgmode/org/mappings.lua

+5
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,11 @@ function OrgMappings:org_return()
590590
rhs = vim.api.nvim_eval(rhs)
591591
end
592592

593+
-- If the rhs is empty, assume that callback already handled the action
594+
if old_mapping.callback and not rhs then
595+
return
596+
end
597+
593598
return vim.api.nvim_feedkeys(rhs, 'n', true)
594599
end
595600

0 commit comments

Comments
 (0)