Fix #1329
This commit is contained in:
@@ -378,7 +378,11 @@ core.confirm = function(self, e, option, callback)
|
|||||||
feedkeys.call(table.concat(keys, ''), 'in')
|
feedkeys.call(table.concat(keys, ''), 'in')
|
||||||
else
|
else
|
||||||
vim.cmd([[silent! undojoin]])
|
vim.cmd([[silent! undojoin]])
|
||||||
vim.api.nvim_set_current_line(e.context.cursor_line)
|
-- This logic must be used nvim_buf_set_text.
|
||||||
|
-- If not used, the snippet engine's placeholder wil be broken.
|
||||||
|
vim.api.nvim_buf_set_text(0, e.context.cursor.row - 1, e:get_offset() - 1, ctx.cursor.row - 1, ctx.cursor.col - 1, {
|
||||||
|
e.context.cursor_before_line:sub(e:get_offset())
|
||||||
|
})
|
||||||
vim.api.nvim_win_set_cursor(0, { e.context.cursor.row, e.context.cursor.col - 1 })
|
vim.api.nvim_win_set_cursor(0, { e.context.cursor.row, e.context.cursor.col - 1 })
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user