mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.2671: error for line number in legacy script
Problem: Error for line number in legacy script. Solution: Check for number type.f6bdd82c7e
N/A patches for version.c: vim-patch:8.2.2670: Vim9: error for append(0, text) Problem: Vim9: error for append(0, text). Solution: Check for negative number. (closes vim/vim#8022)b2ac7d0663
This commit is contained in:
parent
9c272b75ec
commit
5c9f6bdd8c
@ -3751,8 +3751,9 @@ linenr_T tv_get_lnum(const typval_T *const tv)
|
|||||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||||
{
|
{
|
||||||
linenr_T lnum = (linenr_T)tv_get_number_chk(tv, NULL);
|
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 && tv->v_type != VAR_NUMBER) {
|
||||||
int fnum;
|
int fnum;
|
||||||
|
// No valid number, try using same function as line() does.
|
||||||
pos_T *const fp = var2fpos(tv, true, &fnum, false);
|
pos_T *const fp = var2fpos(tv, true, &fnum, false);
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
lnum = fp->lnum;
|
lnum = fp->lnum;
|
||||||
|
Loading…
Reference in New Issue
Block a user