mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-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 vim/vim#7690
9ebcf231bd
This commit is contained in:
parent
6ab71683d1
commit
8c3244c9a1
@ -1584,7 +1584,7 @@ static void set_cursorpos(typval_T *argvars, typval_T *rettv, bool charcol)
|
||||
set_curswant = false;
|
||||
}
|
||||
} else if ((argvars[0].v_type == VAR_NUMBER || 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);
|
||||
col = (long)tv_get_number_chk(&argvars[1], NULL);
|
||||
if (charcol) {
|
||||
|
@ -24,6 +24,9 @@ func Test_move_cursor()
|
||||
" below last line goes to last line
|
||||
call cursor(9, 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 cursor(1, 1, 1)
|
||||
|
Loading…
Reference in New Issue
Block a user