From e74b92b7333d3382277a6794833126d8e9ebd5cd Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 4 Sep 2023 15:07:54 -0700 Subject: show any error after switching to source editor Error_message is a special global. It's set when the app (Current_app = 'run') encounters an error and switches to the source editor, and cleared when switching from source editor back to the app. --- source.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source.lua') diff --git a/source.lua b/source.lua index a3fd217..b4e1078 100644 --- a/source.lua +++ b/source.lua @@ -252,6 +252,13 @@ function source.draw() log_browser.draw(Log_browser_state, --[[hide_cursor]] Focus ~= 'log_browser') end source.draw_menu_bar() + if Error_message then + local height = math.min(20*Editor_state.line_height, App.screen.height*0.2) + App.color{r=0.8,g=0,b=0} + love.graphics.rectangle('fill', 150, App.screen.height - height-10, App.screen.width, height+10) + App.color{r=0,g=0,b=0} + love.graphics.print(Error_message, 150+10, App.screen.height - height) + end end function source.update(dt) -- cgit 1.4.1-2-gfad0