]> granicus.if.org Git - vim/commitdiff
patch 7.4.1093 v7.4.1093
authorBram Moolenaar <Bram@vim.org>
Fri, 15 Jan 2016 14:37:20 +0000 (15:37 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 15 Jan 2016 14:37:20 +0000 (15:37 +0100)
Problem:    Typo in test goes unnoticed.
Solution:   Fix the typo. Give error for wrong arguments to cursor().
            (partly by Hirohito Higashi) Add a test for cursor().

src/eval.c
src/testdir/test_alot.vim
src/testdir/test_searchpos.vim
src/version.c

index 34f2bde85217487edb6cac918d11871bcb9f8902..5eddf2368e7ec84c37a1a67c69c826cf675da682 100644 (file)
@@ -10243,7 +10243,8 @@ f_cscope_connection(argvars, rettv)
 }
 
 /*
- * "cursor(lnum, col)" function
+ * "cursor(lnum, col)" function, or
+ * "cursor(list)"
  *
  * Moves the cursor to the specified line and column.
  * Returns 0 when the position could be set, -1 otherwise.
@@ -10266,7 +10267,10 @@ f_cursor(argvars, rettv)
        colnr_T     curswant = -1;
 
        if (list2fpos(argvars, &pos, NULL, &curswant) == FAIL)
+       {
+           EMSG(_(e_invarg));
            return;
+       }
        line = pos.lnum;
        col = pos.col;
 #ifdef FEAT_VIRTUALEDIT
index 413e71b54348b8659ffb794b4fb8018030ac7fb7..87bd26b45814c28578f4be07820201ae55b4ce0e 100644 (file)
@@ -2,6 +2,7 @@
 " This makes testing go faster, since Vim doesn't need to restart.
 
 source test_backspace_opt.vim
+source test_cursor_func.vim
 source test_lispwords.vim
 source test_menu.vim
 source test_searchpos.vim
index 4a1e024ce71433262a7169ec120f0d2a08ad0951..8dffddc094f258319417652f4a62036765987dc9 100644 (file)
@@ -15,10 +15,10 @@ func Test_searchpos()
   call assert_equal([1, 3, 1], searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW'))
 
   " Now with \zs, first match is in column 0, "a" is matched.
-  call cursor(1. 3)
+  call cursor(1, 3)
   call assert_equal([2, 4, 2], searchpos('\%(\([a-z]\)\|\_.\)\{-}\zsxyz', 'pcW'))
   " With z flag start at cursor column, don't see the "a".
-  call cursor(1. 3)
+  call cursor(1, 3)
   call assert_equal([2, 4, 1], searchpos('\%(\([a-z]\)\|\_.\)\{-}\zsxyz', 'pcWz'))
 
   set cpo+=c
index 599de704cab6fb4a3b35b641aa6e26705bad9636..2567cb5819b77a2131c5ae04cde0ca3ff601f055 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1093,
 /**/
     1092,
 /**/