Skip to content

Commit 4930a76

Browse files
committed
patch 7.4.2362
Problem: Illegal memory access with ":1@". (Dominique Pelle) Solution: Correct cursor column after setting the line number. Also avoid calling end_visual_mode() when not in Visual mode.
1 parent ee39ef0 commit 4930a76

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ close_buffer(
580580

581581
/* When closing the current buffer stop Visual mode before freeing
582582
* anything. */
583-
if (buf == curbuf
583+
if (buf == curbuf && VIsual_active
584584
#if defined(EXITFREE)
585585
&& !entered_free_all_mem
586586
#endif
@@ -1389,7 +1389,7 @@ do_buffer(
13891389
}
13901390

13911391
/* When closing the current buffer stop Visual mode. */
1392-
if (buf == curbuf)
1392+
if (buf == curbuf && VIsual_active)
13931393
end_visual_mode();
13941394

13951395
/*

src/ex_docmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9388,6 +9388,7 @@ ex_at(exarg_T *eap)
93889388
int prev_len = typebuf.tb_len;
93899389

93909390
curwin->w_cursor.lnum = eap->line2;
9391+
check_cursor_col();
93919392

93929393
#ifdef USE_ON_FLY_SCROLL
93939394
dont_scroll = TRUE; /* disallow scrolling here */

src/version.c

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

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2362,
766768
/**/
767769
2361,
768770
/**/

0 commit comments

Comments
 (0)