mirror of
https://github.com/neovim/neovim.git
synced 2026-03-29 03:42:11 +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:
@@ -1157,7 +1157,7 @@ local function show_confirm_buf(lines, on_finish)
|
||||
--- @type integer
|
||||
local cancel_au_id
|
||||
local function on_cancel(data)
|
||||
if tonumber(data.match) ~= win_id then
|
||||
if vim._tointeger(data.match) ~= win_id then
|
||||
return
|
||||
end
|
||||
pcall(api.nvim_del_autocmd, cancel_au_id)
|
||||
|
||||
Reference in New Issue
Block a user