about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-09-04 15:07:54 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-09-04 15:07:54 -0700
commite74b92b7333d3382277a6794833126d8e9ebd5cd (patch)
tree7ddfd3e51d2927fc0fd99fd0334f40f544ed9a6a /main.lua
parentadfe94b9fcf04cc52032467d8970aaf9cd4ea6dc (diff)
downloadlines.love-e74b92b7333d3382277a6794833126d8e9ebd5cd.tar.gz
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.
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index a59c483..c3b5a26 100644
--- a/main.lua
+++ b/main.lua
@@ -183,10 +183,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