add 'write to read-only entry point' warnings

This commit is contained in:
MihailRis
2024-11-07 21:57:27 +03:00
parent f22108f6b4
commit 71eadb2fde
2 changed files with 30 additions and 14 deletions
+8 -1
View File
@@ -1,12 +1,19 @@
history = session.get_entry("commands_history")
history_pointer = #history
local warnings_all = {}
local warning_id = 0
events.on("core:warning", function (wtype, text)
local full = wtype..": "..text
if table.has(warnings_all, full) then
return
end
document.problemsLog:add(gui.template("problem", {
type="warning", text=wtype..": "..text, id=tostring(warning_id)
type="warning", text=full, id=tostring(warning_id)
}))
warning_id = warning_id + 1
table.insert(warnings_all, full)
end)
function setup_variables()