mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.2363: curpos() does not accept a string argument as before
Problem: curpos() does not accept a string argument as before. solution: Make a string argument work again. (Yegappan Lakshmanan, closes #7690
This commit is contained in:
parent
351ead09dd
commit
9ebcf231bd
@ -2767,7 +2767,8 @@ set_cursorpos(typval_T *argvars, typval_T *rettv, int charcol)
|
|||||||
}
|
}
|
||||||
else if ((argvars[0].v_type == VAR_NUMBER ||
|
else if ((argvars[0].v_type == VAR_NUMBER ||
|
||||||
argvars[0].v_type == VAR_STRING)
|
argvars[0].v_type == VAR_STRING)
|
||||||
&& argvars[1].v_type == VAR_NUMBER)
|
&& (argvars[1].v_type == VAR_NUMBER ||
|
||||||
|
argvars[1].v_type == VAR_STRING))
|
||||||
{
|
{
|
||||||
line = tv_get_lnum(argvars);
|
line = tv_get_lnum(argvars);
|
||||||
if (line < 0)
|
if (line < 0)
|
||||||
|
@ -25,6 +25,9 @@ func Test_move_cursor()
|
|||||||
" below last line goes to last line
|
" below last line goes to last line
|
||||||
eval [9, 1]->cursor()
|
eval [9, 1]->cursor()
|
||||||
call assert_equal([4, 1, 0, 1], getcurpos()[1:])
|
call assert_equal([4, 1, 0, 1], getcurpos()[1:])
|
||||||
|
" pass string arguments
|
||||||
|
call cursor('3', '3')
|
||||||
|
call assert_equal([3, 3, 0, 3], getcurpos()[1:])
|
||||||
|
|
||||||
call setline(1, ["\<TAB>"])
|
call setline(1, ["\<TAB>"])
|
||||||
call cursor(1, 1, 1)
|
call cursor(1, 1, 1)
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2363,
|
||||||
/**/
|
/**/
|
||||||
2362,
|
2362,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user