Skip to content

Commit 23fa81d

Browse files
committed
patch 8.0.0291: Visual block insertion does not insert in all lines
Problem: Visual block insertion does not insert in all lines. Solution: Don't bail out of insert too early. Add a test. (Christian Brabandt, closes #1290)
1 parent 04e87b7 commit 23fa81d

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/ops.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,8 +2571,7 @@ op_insert(oparg_T *oap, long count1)
25712571
}
25722572

25732573
t1 = oap->start;
2574-
if (edit(NUL, FALSE, (linenr_T)count1))
2575-
return;
2574+
(void)edit(NUL, FALSE, (linenr_T)count1);
25762575

25772576
/* When a tab was inserted, and the characters in front of the tab
25782577
* have been converted to a tab as well, the column of the cursor

src/testdir/test_visual.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,16 @@ func Test_dotregister_paste()
2323
call assert_equal('hello world world', getline(1))
2424
q!
2525
endfunc
26+
27+
func Test_Visual_ctrl_o()
28+
new
29+
call setline(1, ['one', 'two', 'three'])
30+
call cursor(1,2)
31+
set noshowmode
32+
set tw=0
33+
call feedkeys("\<c-v>jjlIa\<c-\>\<c-o>:set tw=88\<cr>\<esc>", 'tx')
34+
call assert_equal(['oane', 'tawo', 'tahree'], getline(1, 3))
35+
call assert_equal(88, &tw)
36+
set tw&
37+
bw!
38+
endfu

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
291,
767769
/**/
768770
290,
769771
/**/

0 commit comments

Comments
 (0)