diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-11-09 21:18:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-09 21:18:51 -0800 |
commit | 7a23b67d3594ffb8b6d8629fd9ca1ef8147596db (patch) | |
tree | f022b95c3bed957190d7b03d98e31f73dd3860f8 /src/nvim/lua/vim.lua | |
parent | 5689008060d29dd7b45157a8f82cb96018c284e8 (diff) | |
download | rneovim-7a23b67d3594ffb8b6d8629fd9ca1ef8147596db.tar.gz rneovim-7a23b67d3594ffb8b6d8629fd9ca1ef8147596db.tar.bz2 rneovim-7a23b67d3594ffb8b6d8629fd9ca1ef8147596db.zip |
paste: Select-mode, Visual-mode #11360
fix #11344
Diffstat (limited to 'src/nvim/lua/vim.lua')
-rw-r--r-- | src/nvim/lua/vim.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index adb90084db..1ebdde99d5 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -206,8 +206,11 @@ paste = (function() local line1 = lines[1]:gsub('<', '<lt>'):gsub('[\r\n\012\027]', ' ') -- Scrub. vim.api.nvim_input(line1) vim.api.nvim_set_option('paste', false) - elseif mode ~= 'c' then -- Else: discard remaining cmdline-mode chunks. - if phase < 2 and mode ~= 'i' and mode ~= 'R' and mode ~= 't' then + elseif mode ~= 'c' then + if phase < 2 and mode:find('^[vV\22sS\19]') then + vim.api.nvim_command([[exe "normal! \<Del>"]]) + vim.api.nvim_put(lines, 'c', false, true) + elseif phase < 2 and not mode:find('^[iRt]') then vim.api.nvim_put(lines, 'c', true, true) -- XXX: Normal-mode: workaround bad cursor-placement after first chunk. vim.api.nvim_command('normal! a') |