Improve macro handling

This commit is contained in:
hrsh7th
2022-04-08 22:04:08 +09:00
parent 27970d8a1c
commit 801a9f98bb
4 changed files with 21 additions and 30 deletions

View File

@@ -374,7 +374,7 @@ core.confirm = function(self, e, option, callback)
local keys = {}
table.insert(keys, keymap.backspace(ctx.cursor.character - misc.to_utfindex(ctx.cursor_line, e:get_offset())))
table.insert(keys, string.sub(e.context.cursor_before_line, e:get_offset()))
feedkeys.call(table.concat(keys, ''), 'int')
feedkeys.call(table.concat(keys, ''), 'in')
else
vim.api.nvim_buf_set_text(0, ctx.cursor.row - 1, e:get_offset() - 1, ctx.cursor.row - 1, ctx.cursor.col - 1, {
string.sub(e.context.cursor_before_line, e:get_offset()),
@@ -462,7 +462,7 @@ core.confirm = function(self, e, option, callback)
table.insert(keys, string.rep(keymap.t('<BS>'), diff_before))
table.insert(keys, string.rep(keymap.t('<Del>'), diff_after))
table.insert(keys, new_text)
feedkeys.call(table.concat(keys, ''), 'int')
feedkeys.call(table.concat(keys, ''), 'in')
end
end)
feedkeys.call(keymap.indentkeys(vim.bo.indentkeys), 'n')