Fix #1144
This commit is contained in:
@@ -369,6 +369,7 @@ core.confirm = function(self, e, option, callback)
|
|||||||
table.insert(keys, string.sub(e.context.cursor_before_line, e:get_offset()))
|
table.insert(keys, string.sub(e.context.cursor_before_line, e:get_offset()))
|
||||||
feedkeys.call(table.concat(keys, ''), 'in')
|
feedkeys.call(table.concat(keys, ''), 'in')
|
||||||
else
|
else
|
||||||
|
vim.cmd([[silent! undojoin]])
|
||||||
vim.api.nvim_buf_set_text(0, ctx.cursor.row - 1, e:get_offset() - 1, ctx.cursor.row - 1, ctx.cursor.col - 1, {
|
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()),
|
string.sub(e.context.cursor_before_line, e:get_offset()),
|
||||||
})
|
})
|
||||||
@@ -400,9 +401,11 @@ core.confirm = function(self, e, option, callback)
|
|||||||
if has_cursor_line_text_edit then
|
if has_cursor_line_text_edit then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
vim.cmd([[silent! undojoin]])
|
||||||
vim.lsp.util.apply_text_edits(text_edits, ctx.bufnr, 'utf-16')
|
vim.lsp.util.apply_text_edits(text_edits, ctx.bufnr, 'utf-16')
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
|
vim.cmd([[silent! undojoin]])
|
||||||
vim.lsp.util.apply_text_edits(e:get_completion_item().additionalTextEdits, ctx.bufnr, 'utf-16')
|
vim.lsp.util.apply_text_edits(e:get_completion_item().additionalTextEdits, ctx.bufnr, 'utf-16')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -460,6 +463,7 @@ core.confirm = function(self, e, option, callback)
|
|||||||
end)
|
end)
|
||||||
feedkeys.call(keymap.indentkeys(vim.bo.indentkeys), 'n')
|
feedkeys.call(keymap.indentkeys(vim.bo.indentkeys), 'n')
|
||||||
feedkeys.call('', 'n', function()
|
feedkeys.call('', 'n', function()
|
||||||
|
release()
|
||||||
e:execute(vim.schedule_wrap(function()
|
e:execute(vim.schedule_wrap(function()
|
||||||
release()
|
release()
|
||||||
self.event:emit('confirm_done', {
|
self.event:emit('confirm_done', {
|
||||||
|
|||||||
Reference in New Issue
Block a user