Skip to content

Commit 84b2a38

Browse files
committed
patch 8.0.0330: illegal memory access after "vapo"
Problem: Illegal memory access after "vapo". (Dominique Pelle) Solution: Fix the cursor column.
1 parent 1043467 commit 84b2a38

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/search.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4241,7 +4241,11 @@ current_par(
42414241
* line, we get stuck there. Trap this here. */
42424242
if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum)
42434243
goto extend;
4244-
VIsual.lnum = start_lnum;
4244+
if (VIsual.lnum != start_lnum)
4245+
{
4246+
VIsual.lnum = start_lnum;
4247+
VIsual.col = 0;
4248+
}
42454249
VIsual_mode = 'V';
42464250
redraw_curbuf_later(INVERTED); /* update the inversion */
42474251
showmode();

src/testdir/test_visual.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ func Test_Visual_ctrl_o()
3636
set tw&
3737
bw!
3838
endfu
39+
40+
func Test_Visual_vapo()
41+
new
42+
normal oxx
43+
normal vapo
44+
bwipe!
45+
endfunc

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+
330,
767769
/**/
768770
329,
769771
/**/

0 commit comments

Comments
 (0)