summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-15 15:37:20 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-15 15:37:20 +0100
commit24c4d539eed33e8073f8f9fe2bee497bbba935a4 (patch)
tree5ebe42941efb39c6c274ee165736eaaafddc8edc /src
parenta803c7f94070f94b831fdfd1984f288c8b825b5d (diff)
downloadvim-24c4d539eed33e8073f8f9fe2bee497bbba935a4.zip
patch 7.4.1093
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().
Diffstat (limited to 'src')
-rw-r--r--src/eval.c6
-rw-r--r--src/testdir/test_alot.vim1
-rw-r--r--src/testdir/test_searchpos.vim4
-rw-r--r--src/version.c2
4 files changed, 10 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c
index 34f2bde85..5eddf2368 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -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
diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim
index 413e71b54..87bd26b45 100644
--- a/src/testdir/test_alot.vim
+++ b/src/testdir/test_alot.vim
@@ -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
diff --git a/src/testdir/test_searchpos.vim b/src/testdir/test_searchpos.vim
index 4a1e024ce..8dffddc09 100644
--- a/src/testdir/test_searchpos.vim
+++ b/src/testdir/test_searchpos.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index 599de704c..2567cb581 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1093,
+/**/
1092,
/**/
1091,