Skip to content

Commit de8c5b9

Browse files
Fix org_return mapping fallback. Closes #315
1 parent 35f4fb6 commit de8c5b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/orgmode/org/mappings.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,12 @@ function OrgMappings:org_return()
443443
end
444444
end
445445

446-
return vim.api.nvim_feedkeys(utils.esc(config.old_cr_mapping or '<CR>'), 'n', true)
446+
local fallback_mapping = '<CR>'
447+
if config.old_cr_mapping and config.old_cr_mapping ~= '' then
448+
fallback_mapping = config.old_cr_mapping
449+
end
450+
451+
return vim.api.nvim_feedkeys(utils.esc(fallback_mapping), 'n', true)
447452
end
448453

449454
function OrgMappings:handle_return(suffix)

0 commit comments

Comments
 (0)