aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_core
diff options
context:
space:
mode:
authorYi Ming <ofseed@foxmail.com>2026-05-06 04:32:20 +0800
committerGitHub <noreply@github.com>2026-05-05 16:32:20 -0400
commit264fbc0ace0b701ac6fa8fe217d42950c8fd79c3 (patch)
tree5272f66e2c2f0c70aebd7f8b113782228330b21e /runtime/lua/vim/_core
parentb1ebf45a6d251fc81446fa21d9b2bf25bcc87c5e (diff)
downloadrneovim-264fbc0ace0b701ac6fa8fe217d42950c8fd79c3.tar.gz
rneovim-264fbc0ace0b701ac6fa8fe217d42950c8fd79c3.tar.bz2
rneovim-264fbc0ace0b701ac6fa8fe217d42950c8fd79c3.zip
fix(lua): avoid `__index` when deciding if a table is a list #39556
Problem: When a table has `__index`, `vim.islist` is unreliable. Solution: Index using `rawget`.
Diffstat (limited to 'runtime/lua/vim/_core')
-rw-r--r--runtime/lua/vim/_core/shared.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/_core/shared.lua b/runtime/lua/vim/_core/shared.lua
index 6df4c85ae7..893171e3a2 100644
--- a/runtime/lua/vim/_core/shared.lua
+++ b/runtime/lua/vim/_core/shared.lua
@@ -960,7 +960,7 @@ function vim.islist(t)
for _ in
pairs(t--[[@as table<any,any>]])
do
- if t[j] == nil then
+ if rawget(t, j) == nil then
return false
end
j = j + 1