mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
vim-patch:8.2.2184: Vim9: no error when using "2" for a line number
Problem: Vim9: no error when using "2" for a line number. Solution: Give an error message if the line number is invalid. (closes vim/vim#7492)9a963377b4
N/A patches for version.c: vim-patch:8.2.1465: Vim9: subscript not handled properly Problem: Vim9: subscript not handled properly. Solution: Adjust error message. Remove dead code. Disallow string to number conversion in scripts.56acb0943e
This commit is contained in:
@@ -3751,7 +3751,7 @@ linenr_T tv_get_lnum(const typval_T *const tv)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
linenr_T lnum = (linenr_T)tv_get_number_chk(tv, NULL);
|
||||
if (lnum == 0) { // No valid number, try using same function as line() does.
|
||||
if (lnum <= 0) { // No valid number, try using same function as line() does.
|
||||
int fnum;
|
||||
pos_T *const fp = var2fpos(tv, true, &fnum, false);
|
||||
if (fp != NULL) {
|
||||
|
Reference in New Issue
Block a user