Skip to content

Commit 6fb7a62

Browse files
fix(mappings): Bind old <CR> to proper buffer
1 parent b3bef73 commit 6fb7a62

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lua/orgmode/config/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ end
211211
---@param buffer number? Buffer id
212212
---@see orgmode.config.mappings
213213
function Config:setup_mappings(category, buffer)
214-
if category == 'org' and vim.bo.filetype == 'org' and not vim.b.org_old_cr_mapping then
215-
vim.b.org_old_cr_mapping = utils.get_keymap({
214+
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({
216216
mode = 'i',
217217
lhs = '<CR>',
218-
buffer = buffer or vim.api.nvim_get_current_buf(),
218+
buffer = buffer,
219219
})
220220
end
221221
local maps = self:get_mappings(category, buffer)

lua/orgmode/utils/init.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ end
415415
function utils.open_tmp_org_window(height, split_mode, border, on_close)
416416
local prev_winnr = vim.api.nvim_get_current_win()
417417
utils.open_window(vim.fn.tempname() .. '.org', height or 16, split_mode, border)
418-
vim.cmd([[setf org]])
419418
vim.cmd([[setlocal bufhidden=wipe nobuflisted nolist noswapfile nofoldenable]])
420419
local bufnr = vim.api.nvim_get_current_buf()
421420

0 commit comments

Comments
 (0)