summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-12-11 21:34:23 +0100
committerBram Moolenaar <Bram@vim.org>2016-12-11 21:34:23 +0100
commitfe38b494fff56cd9b2fcaeef26a8fd7b6557d69c (patch)
tree725bdd29a8b36d1a3fdf192b0a0480b17f0d05c8
parent4c8980b717f73042f1d625ee255fa74eddb989ba (diff)
downloadvim-git-8.0.0133.tar.gz
patch 8.0.0133v8.0.0133
Problem: "2;'(" causes ml_get errors in an empty buffer. (Dominique Pelle) Solution: Check the cursor line earlier.
-rw-r--r--src/ex_docmd.c7
-rw-r--r--src/testdir/test_cmdline.vim7
-rw-r--r--src/version.c2
3 files changed, 13 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 439467cf1..2b0f15ee9 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2277,7 +2277,11 @@ do_one_cmd(
if (*ea.cmd == ';')
{
if (!ea.skip)
+ {
curwin->w_cursor.lnum = ea.line2;
+ /* don't leave the cursor on an illegal line */
+ check_cursor_lnum();
+ }
}
else if (*ea.cmd != ',')
break;
@@ -2293,9 +2297,6 @@ do_one_cmd(
ea.addr_count = 0;
}
- /* Don't leave the cursor on an illegal line (caused by ';') */
- check_cursor_lnum();
-
/*
* 5. Parse the command.
*/
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index c48a8117f..96fee0b1c 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -234,3 +234,10 @@ func Test_remove_char_in_cmdline()
call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
call assert_equal('"def', @:)
endfunc
+
+func Test_illegal_address()
+ new
+ 2;'(
+ 2;')
+ quit
+endfunc
diff --git a/src/version.c b/src/version.c
index b21e60a66..2e3cb057e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 133,
+/**/
132,
/**/
131,