Skip to content

Commit

Permalink
fix(command): evaluate unquoated string args
Browse files Browse the repository at this point in the history
See #297
  • Loading branch information
Rónán Carrigan committed Oct 20, 2023
1 parent da628ed commit 9018914
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/neotest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ commands = {
}

local function eval_luastring(value)
return loadstring("return " .. value, value)()
local evaluated = loadstring("return " .. value, value)()
if evaluated == nil then
-- Treat as unquoted string
evaluated = value
end
return evaluated
end

local function make_params(info, args)
Expand Down

0 comments on commit 9018914

Please sign in to comment.