diff options
author | André Twupack <atwupack@mailbox.org> | 2014-09-19 21:12:47 +0200 |
---|---|---|
committer | André Twupack <atwupack@mailbox.org> | 2014-09-19 21:12:47 +0200 |
commit | ea492696cfbb5912b9b42112159a028e24f9e2fc (patch) | |
tree | 862dc1c821934139ad40c17768d03e6d71719a77 | |
parent | 6cc6b0ff9eb5bba50d125199b984cb1a374e4f77 (diff) | |
download | rneovim-ea492696cfbb5912b9b42112159a028e24f9e2fc.tar.gz rneovim-ea492696cfbb5912b9b42112159a028e24f9e2fc.tar.bz2 rneovim-ea492696cfbb5912b9b42112159a028e24f9e2fc.zip |
vim-patch:7.4.407
Problem: Inserting text for Visual block mode, with cursor movement,
repeats the wrong text. (Aleksandar Ivanov)
Solution: Reset the update_Insstart_orig flag. (Christian Brabandt)
https://code.google.com/p/vim/source/detail?r=v7-4-407
-rw-r--r-- | src/nvim/edit.c | 10 | ||||
-rw-r--r-- | src/nvim/testdir/test39.in | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test39.ok | bin | 481 -> 514 bytes | |||
-rw-r--r-- | src/nvim/version.c | 2 |
4 files changed, 17 insertions, 3 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 3b450e5245..5131dc3b38 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -5610,12 +5610,18 @@ static void spell_back_to_badword(void) int stop_arrow(void) { if (arrow_used) { + Insstart = curwin->w_cursor; //new insertion starts here + if (Insstart.col > Insstart_orig.col && !ins_need_undo) { + // Don't update the original insert position when moved to the + // right, except when nothing was inserted yet. + update_Insstart_orig = FALSE; + } + Insstart_textlen = (colnr_T)linetabsize(get_cursor_line_ptr()); + if (u_save_cursor() == OK) { arrow_used = FALSE; ins_need_undo = FALSE; } - Insstart = curwin->w_cursor; /* new insertion starts here */ - Insstart_textlen = (colnr_T)linetabsize(get_cursor_line_ptr()); ai_col = 0; if (State & VREPLACE_FLAG) { orig_line_count = curbuf->b_ml.ml_line_count; diff --git a/src/nvim/testdir/test39.in b/src/nvim/testdir/test39.in index c1e1cc49a6..7d1c672522 100644 --- a/src/nvim/testdir/test39.in +++ b/src/nvim/testdir/test39.in @@ -23,6 +23,9 @@ G$khhhhhkkcmno /^aaaa/ :exe ":norm! l\<C-V>jjjlllI\<Right>\<Right> \<Esc>" :/^aa/,/^$/w >> test.out +/xaaa$/ +:exe ":norm! \<C-V>jjjI<>\<Left>p\<Esc>" +:/xaaa$/,/^$/w >> test.out :" Test for Visual block was created with the last <C-v>$ /^A23$/ :exe ":norm! l\<C-V>j$Aab\<Esc>" @@ -77,6 +80,11 @@ bbbbbb cccccc dddddd +xaaa +bbbb +cccc +dddd + A23 4567 diff --git a/src/nvim/testdir/test39.ok b/src/nvim/testdir/test39.ok Binary files differindex ef7a2c6442..d8e901563a 100644 --- a/src/nvim/testdir/test39.ok +++ b/src/nvim/testdir/test39.ok diff --git a/src/nvim/version.c b/src/nvim/version.c index f80b2f8a41..1f3e7a7e38 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -188,7 +188,7 @@ static int included_patches[] = { //410, //409 NA //408, - //407, + 407, //406, //405, //404 NA |