diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2023-09-04 15:24:31 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2023-09-04 15:24:31 -0700 |
commit | 60b6308fc7fff6a9fae20a12e0e1364be9c89e17 (patch) | |
tree | d24386597d734f84cf756fae65eb6b714a57fbf0 | |
parent | 93eb3ee97da7935207ffb5c9d28c1663e7609aff (diff) | |
parent | 529857ad73da8c43ca6b13f4cb3cdd83e0648c57 (diff) | |
download | view.love-60b6308fc7fff6a9fae20a12e0e1364be9c89e17.tar.gz |
Merge text.love
-rw-r--r-- | main.lua | 2 | ||||
-rw-r--r-- | source.lua | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/main.lua b/main.lua index 39b9ae0..335f5ec 100644 --- a/main.lua +++ b/main.lua @@ -180,10 +180,12 @@ function App.keychord_press(chord, key) Settings.source = source_settings if run.quit then run.quit() end Current_app = 'source' + -- preserve any Error_message when going from run to source elseif Current_app == 'source' then Settings.source = source.settings() if source.quit then source.quit() end Current_app = 'run' + Error_message = nil else assert(false, 'unknown app "'..Current_app..'"') end diff --git a/source.lua b/source.lua index 2b9b1a4..cfe0b90 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) |