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().
}
/*
- * "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.
colnr_T curswant = -1;
if (list2fpos(argvars, &pos, NULL, &curswant) == FAIL)
+ {
+ EMSG(_(e_invarg));
return;
+ }
line = pos.lnum;
col = pos.col;
#ifdef FEAT_VIRTUALEDIT
" 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
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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1093,
/**/
1092,
/**/