mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2425: cursor on invalid line with range and :substitute
Problem: Cursor on invalid line with range and :substitute. Solution: Do not move the cursor when skipping commands. (closes #3434)
This commit is contained in:
@@ -3747,6 +3747,8 @@ ex_substitute(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
linenr_T joined_lines_count;
|
linenr_T joined_lines_count;
|
||||||
|
|
||||||
|
if (eap->skip)
|
||||||
|
return;
|
||||||
curwin->w_cursor.lnum = eap->line1;
|
curwin->w_cursor.lnum = eap->line1;
|
||||||
if (*cmd == 'l')
|
if (*cmd == 'l')
|
||||||
eap->flags = EXFLAG_LIST;
|
eap->flags = EXFLAG_LIST;
|
||||||
|
@@ -68,6 +68,11 @@ func Test_for_invalid()
|
|||||||
call assert_fails("for x in 99", 'E714:')
|
call assert_fails("for x in 99", 'E714:')
|
||||||
call assert_fails("for x in 'asdf'", 'E714:')
|
call assert_fails("for x in 'asdf'", 'E714:')
|
||||||
call assert_fails("for x in {'a': 9}", 'E714:')
|
call assert_fails("for x in {'a': 9}", 'E714:')
|
||||||
|
|
||||||
|
if 0
|
||||||
|
/1/5/2/s/\n
|
||||||
|
endif
|
||||||
|
redraw
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_readfile_binary()
|
func Test_readfile_binary()
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2425,
|
||||||
/**/
|
/**/
|
||||||
2424,
|
2424,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user