From ade541e6e3493624ee45e818245fee87fa9edfc4 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 24 Feb 2026 22:31:37 -0500 Subject: [PATCH] fix(diff): cast tonumber result to integer Problem: LuaLS infers priority as integer from the = 0 initialiser but tonumber returns number?, causing a cast-local-type diagnostic. Solution: inline --[[@as integer]] cast after the tonumber call. --- lua/pending/diff.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pending/diff.lua b/lua/pending/diff.lua index 1107b31..607aef6 100644 --- a/lua/pending/diff.lua +++ b/lua/pending/diff.lua @@ -37,7 +37,7 @@ function M.parse_buffer(lines) local prio_str = stripped:match('^%[(%d+)%] ') local priority = 0 if prio_str then - priority = tonumber(prio_str) + priority = tonumber(prio_str) --[[@as integer]] stripped = stripped:sub(#prio_str + 4) end local description, metadata = parse.body(stripped)