blob: 83a831a590c260fc22d6aa803df46e69dc203494 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
vis:command_register("check", function(_, _, win)
local fd = vis:communicate("check", "luacheck --no-color " .. win.file.path)
if not fd then
vis:info("error")
end
vis.events.subscribe(vis.events.PROCESS_RESPONSE, function(name, _, _, msg)
if name ~= "check" then
return
end
vis:message(msg)
end)
end, "Check for errors in the file")
|