mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user