diff options
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/_editor.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index c9b8e68c10..6a8b23ba40 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -213,7 +213,7 @@ end vim.inspect = vim.inspect do - local tdots, tick, got_line1, undo_started, trailing_nl = 0, 0, false, false, false + local startpos, tdots, tick, got_line1, undo_started, trailing_nl = nil, 0, 0, false, false, false --- Paste handler, invoked by |nvim_paste()|. --- @@ -328,7 +328,13 @@ do -- message when there are zero dots. vim.api.nvim_command(('echo "%s"'):format(dots)) end + if startpos == nil then + startpos = vim.fn.getpos("'[") + else + vim.fn.setpos("'[", startpos) + end if is_last_chunk then + startpos = nil vim.api.nvim_command('redraw' .. (tick > 1 and '|echo ""' or '')) end return true -- Paste will not continue if not returning `true`. |