diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-08 13:48:46 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-08 15:37:32 -0700 |
commit | 0dea44f93ce925baedf0f2d39d799f36671986b6 (patch) | |
tree | 359e022dcf6fe122a463dbd45cdeebce610aa592 /src | |
parent | ccd947ca4a25edb59e00724d6fb20fb01f3b73f7 (diff) | |
download | rneovim-0dea44f93ce925baedf0f2d39d799f36671986b6.tar.gz rneovim-0dea44f93ce925baedf0f2d39d799f36671986b6.tar.bz2 rneovim-0dea44f93ce925baedf0f2d39d799f36671986b6.zip |
paste/cmdline: discard all chunks after first line
Problem: If multiple paste "chunks" are streamed, chunks after the
first line are pasted into the buffer.
Solution: Check for cmdline-mode for all chunks in a paste-stream.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/lua/vim.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index e76dd9d062..7d5dc0bffc 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -191,10 +191,8 @@ paste = (function() local line1, _ = string.gsub(lines[1], '[\r\n\012\027]', ' ') -- Scrub. vim.api.nvim_input(line1) vim.api.nvim_set_option('paste', false) - elseif mode == 'i' or mode == 'R' then - vim.api.nvim_put(lines, 'c', false, true) - else - vim.api.nvim_put(lines, 'c', true, true) + elseif mode ~= 'c' then + vim.api.nvim_put(lines, 'c', (mode ~= 'i' and mode ~= 'R'), true) end if phase ~= -1 and (now - tdots >= 100) then local dots = ('.'):rep(tick % 4) |