mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
This commit is contained in:
parent
acd2729573
commit
a9e2bae0eb
@ -239,7 +239,7 @@ GUIs can paste by calling |nvim_paste()|.
|
||||
|
||||
PASTE BEHAVIOR ~
|
||||
|
||||
Paste inserts text after the cursor. Lines break at <NL>, <CR>, and <CR><NL>.
|
||||
Paste inserts text before the cursor. Lines break at <NL>, <CR> and <CR><NL>.
|
||||
When pasting a huge amount of text, screen-updates are throttled and the
|
||||
message area shows a "..." pulse.
|
||||
|
||||
|
@ -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)
|
||||
|
@ -485,9 +485,9 @@ describe('TUI', function()
|
||||
feed_data('\n') -- <CR>
|
||||
screen:expect{grid=[[
|
||||
foo |
|
||||
typed input...line A |
|
||||
typed input..line A |
|
||||
line B |
|
||||
{1: } |
|
||||
{1:.} |
|
||||
{5:[No Name] [+] }|
|
||||
|
|
||||
{3:-- TERMINAL --} |
|
||||
|
Loading…
Reference in New Issue
Block a user