diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-08 16:39:06 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-08 16:42:11 -0700 |
commit | a9e2bae0eb6942829dbedfc9c422060da020d8e4 (patch) | |
tree | a8a8af880cb83f0bfb1da9284226868dcf64372f /src/nvim/lua/vim.lua | |
parent | acd2729573171995e8a66be7e09ba4e2fc5d9c69 (diff) | |
download | rneovim-a9e2bae0eb6942829dbedfc9c422060da020d8e4.tar.gz rneovim-a9e2bae0eb6942829dbedfc9c422060da020d8e4.tar.bz2 rneovim-a9e2bae0eb6942829dbedfc9c422060da020d8e4.zip |
paste: insert before cursor always
Inserting "after" the cursor in Normal-mode, for big paste-streams, is
not reliable: sometimes the text "after" the cursor ends up in the
middle of the pasted text. Maybe the cursor position is not updated?
To avoid weird behavior, always paste "before". Maybe nvim_put() or
vim.paste() can be fixed more properly later.
Diffstat (limited to 'src/nvim/lua/vim.lua')
-rw-r--r-- | src/nvim/lua/vim.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index cc10118906..010c3b98ee 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -192,7 +192,7 @@ paste = (function() vim.api.nvim_input(line1) vim.api.nvim_set_option('paste', false) elseif mode ~= 'c' then - vim.api.nvim_put(lines, 'c', (mode ~= 'i' and mode ~= 'R'), true) + vim.api.nvim_put(lines, 'c', false, true) end if phase ~= -1 and (now - tdots >= 100) then local dots = ('.'):rep(tick % 4) |