mirror of
https://github.com/neovim/neovim.git
synced 2026-03-29 11:52:04 +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:
@@ -790,8 +790,7 @@ function M.abspath(path)
|
||||
|
||||
-- Windows allows paths like C:foo/bar, these paths are relative to the current working directory
|
||||
-- of the drive specified in the path
|
||||
local cwd = (iswin and prefix:match('^%w:$')) and uv.fs_realpath(prefix) or uv.cwd()
|
||||
assert(cwd ~= nil)
|
||||
local cwd = assert((iswin and prefix:match('^%w:$')) and uv.fs_realpath(prefix) or uv.cwd())
|
||||
-- Convert cwd path separator to `/`
|
||||
cwd = cwd:gsub(os_sep, '/')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user