aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/fs.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2026-03-12 15:04:05 +0000
committerGitHub <noreply@github.com>2026-03-12 11:04:05 -0400
commitce1154048b11cdc402d0e5da352a3adca19afb56 (patch)
tree02516c918bd7b47e96b02eb83323b917ec4dd37d /runtime/lua/vim/fs.lua
parent2fe07cc9658cfca6dcda1b9b37e5f80e38fd7b19 (diff)
downloadrneovim-ce1154048b11cdc402d0e5da352a3adca19afb56.tar.gz
rneovim-ce1154048b11cdc402d0e5da352a3adca19afb56.tar.bz2
rneovim-ce1154048b11cdc402d0e5da352a3adca19afb56.zip
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
Diffstat (limited to 'runtime/lua/vim/fs.lua')
-rw-r--r--runtime/lua/vim/fs.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua
index dc26790d14..7eadf8cb78 100644
--- a/runtime/lua/vim/fs.lua
+++ b/runtime/lua/vim/fs.lua
@@ -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, '/')