Skip to content

Commit b451154

Browse files
committed
fix(mappings): Default offset encoding when handling <CR> press
1 parent 2fdc13e commit b451154

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lua/orgmode/org/mappings.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local Hyperlinks = require('orgmode.org.hyperlinks')
77
local PriorityState = require('orgmode.objects.priority_state')
88
local TodoState = require('orgmode.objects.todo_state')
99
local config = require('orgmode.config')
10+
local constants = require('orgmode.utils.constants')
1011
local ts_utils = require('nvim-treesitter.ts_utils')
1112
local utils = require('orgmode.utils')
1213

@@ -440,7 +441,7 @@ function OrgMappings:handle_return(suffix)
440441
end
441442

442443
if #text_edits > 0 then
443-
vim.lsp.util.apply_text_edits(text_edits, 0)
444+
vim.lsp.util.apply_text_edits(text_edits, 0, constants.default_offset_encoding)
444445

445446
vim.fn.cursor(end_row + 2 + (add_empty_line and 1 or 0), 0) -- +1 for 0 index and +1 for next line
446447
vim.cmd([[startinsert!]])

lua/orgmode/utils/constants.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return {
2+
default_offset_encoding = 'utf-16',
3+
}

0 commit comments

Comments
 (0)