mirror of
https://github.com/neovim/neovim.git
synced 2026-05-23 21:30:11 +00:00
fix(lua): return v[field] instead of nil when v[field] is false
Problem: When `v[field]` returns `false`, the ternary operator will make it return `nil`. Solution: Return `v[field]` once `v` is not `nil`.
This commit is contained in:
@@ -392,7 +392,7 @@ local function make_key_fn(key)
|
||||
local field = key
|
||||
---@param v any
|
||||
key = function(v)
|
||||
return v and v[field] or nil
|
||||
return v and v[field]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user