Describe the bug
This behaviour was introduced with 6f02b00 (Vim 8.2.2324).
The cursor() function doesn't allow string value for {lnum} and {col}, but string can be passed if the argument is a list.
For example,
" E474: Invalid argument :cal cursor('1', '1') " this is ok even if `{lnum}` and `{col}` are string :cal cursor(['1', '1'])
To Reproduce
vim --clean:call cursor(['1', '1'])1:1:call cursor('1', '1') returns E474: Invalid argument.Expected behavior
Although I'm not sure which is the correct behaviour, if string value is invalid for arguments for cursor function, it should be invalid sting values are passed as a List.
Screenshots
Environment (please complete the following information):
Additional context
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Closed #7686.
I don't think patch 8.2.2324 changed this. It was already like this before, and because of backwards compatibility can't be changed.
You an use Vim9 script, which is much stricter about this.
No, it wasn't. String values are allowed with older versions of Vim 8.2.
I have also confirmed this on Windows.
String value is allowed for {lnum} and {col} in 8.2.2320 (no 2323 build available in vim/vim-win32-installer, so tried with this version), but it's not allowed with the version 8.2.2327 and 8.2.2352.
So this indicates some cursor() function specification was changed with some commit between 8.2.2320 and 8.2.2327; also means they are NOT backwards compatible especially this behaviour.
looks you were misunderstanding each other.. ;-)
For this case, user/legacy-script should be not like more ‘strict’ type check.....
—
You are receiving this because you commented.