aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/typval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-04 14:15:54 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-05-04 16:10:17 +0800
commit7ac63906eae92b5d31fc7e380ef05b8bce73ad8b (patch)
tree8a517de35f00cb41149b6c9c114ebce2f9dd620f /src/nvim/eval/typval.c
parentb9e34571f95b1480607c50d5303b4c63c3370374 (diff)
downloadrneovim-7ac63906eae92b5d31fc7e380ef05b8bce73ad8b.tar.gz
rneovim-7ac63906eae92b5d31fc7e380ef05b8bce73ad8b.tar.bz2
rneovim-7ac63906eae92b5d31fc7e380ef05b8bce73ad8b.zip
vim-patch:8.2.1466: Vim9: cannot index or slice a variable with type "any"
Problem: Vim9: cannot index or slice a variable with type "any". Solution: Add runtime index and slice. https://github.com/vim/vim/commit/cc673e746ab98566556ff964d7a76f2fb46d7f84 Omit E1024 and E1062: Vim9 script only. Omit string_slice() and char_idx2byte(): Vim9 script only. Remove the first tv_is_luafunc() check because it always returns false. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/eval/typval.c')
-rw-r--r--src/nvim/eval/typval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c
index ba1d60959a..8028688ac8 100644
--- a/src/nvim/eval/typval.c
+++ b/src/nvim/eval/typval.c
@@ -795,7 +795,7 @@ int tv_list_slice_or_index(list_T *list, bool range, int n1_arg, int n2_arg, typ
}
return FAIL;
}
- n1 = len;
+ n1 = n1 < 0 ? 0 : len;
}
if (range) {
if (n2 < 0) {