Skip to content

Commit fe38b49

Browse files
committed
patch 8.0.0133
Problem: "2;'(" causes ml_get errors in an empty buffer. (Dominique Pelle) Solution: Check the cursor line earlier.
1 parent 4c8980b commit fe38b49

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/ex_docmd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,11 @@ do_one_cmd(
22772277
if (*ea.cmd == ';')
22782278
{
22792279
if (!ea.skip)
2280+
{
22802281
curwin->w_cursor.lnum = ea.line2;
2282+
/* don't leave the cursor on an illegal line */
2283+
check_cursor_lnum();
2284+
}
22812285
}
22822286
else if (*ea.cmd != ',')
22832287
break;
@@ -2293,9 +2297,6 @@ do_one_cmd(
22932297
ea.addr_count = 0;
22942298
}
22952299

2296-
/* Don't leave the cursor on an illegal line (caused by ';') */
2297-
check_cursor_lnum();
2298-
22992300
/*
23002301
* 5. Parse the command.
23012302
*/

src/testdir/test_cmdline.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,10 @@ func Test_remove_char_in_cmdline()
234234
call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
235235
call assert_equal('"def', @:)
236236
endfunc
237+
238+
func Test_illegal_address()
239+
new
240+
2;'(
241+
2;')
242+
quit
243+
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+
133,
767769
/**/
768770
132,
769771
/**/

0 commit comments

Comments
 (0)