mirror of
https://github.com/neovim/neovim.git
synced 2026-06-30 19:57:54 +00:00
refactor: integer functions, optimize asserts #34112
refactor(lua): add integer coercion helpers Add vim._tointeger() and vim._ensure_integer(), including optional base support, and switch integer-only tonumber()/assert call sites in the Lua runtime to use them. This also cleans up related integer parsing in LSP, health, loader, URI, tohtml, and Treesitter code. supported by AI
This commit is contained in:
@@ -692,7 +692,7 @@ local function create_option_accessor(scope)
|
||||
local option_mt
|
||||
|
||||
local function make_option(name, value)
|
||||
local info = assert(get_options_info(name), 'Not a valid option name: ' .. name)
|
||||
local info = get_options_info(name) or error('Not a valid option name: ' .. name)
|
||||
|
||||
if type(value) == 'table' and getmetatable(value) == option_mt then
|
||||
assert(name == value._name, "must be the same value, otherwise that's weird.")
|
||||
|
||||
Reference in New Issue
Block a user