]> granicus.if.org Git - vim/commitdiff
patch 8.2.1288: Vim9: cannot use mark in range v8.2.1288
authorBram Moolenaar <Bram@vim.org>
Fri, 24 Jul 2020 16:47:22 +0000 (18:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 24 Jul 2020 16:47:22 +0000 (18:47 +0200)
Problem:    Vim9: cannot use mark in range.
Solution:   Use the flag that a colon was seen. (closes #6528)

src/ex_docmd.c
src/testdir/test_vim9_func.vim
src/version.c

index 85747d5f4cae94058dd0bd4a4155b817c9395559..5459cfd7b83a249cfe448770b907c5614e85bd9d 100644 (file)
@@ -1773,7 +1773,7 @@ do_one_cmd(
  */
     cmd = ea.cmd;
 #ifdef FEAT_EVAL
-    starts_with_quote = vim9script && *ea.cmd == '\'';
+    starts_with_quote = vim9script && !starts_with_colon && *ea.cmd == '\'';
     if (!starts_with_quote)
 #endif
        ea.cmd = skip_range(ea.cmd, NULL);
index b0bbab3fdf6a007c2c51892a29650bfef467155c..ef98583fe3c04a7e346c0c029c67589d6a978d62 100644 (file)
@@ -405,6 +405,7 @@ def Test_vim9script_call()
     ("some")->MyFunc()
     assert_equal('some', var)
 
+    # line starting with single quote is not a mark
     'asdfasdf'->MyFunc()
     assert_equal('asdfasdf', var)
 
@@ -414,6 +415,14 @@ def Test_vim9script_call()
     UseString()
     assert_equal('xyork', var)
 
+    # prepending a colon makes it a mark
+    new
+    setline(1, ['aaa', 'bbb', 'ccc'])
+    normal! 3Gmt1G
+    :'t
+    assert_equal(3, getcurpos()[1])
+    bwipe!
+
     MyFunc(
         'continued'
         )
index 8f8ebc6ff84cb28ca240b64e56f8a51f24288b6b..14044481aa47d491a087c4686963e6b5b2260994 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1288,
 /**/
     1287,
 /**/