From 4121613fc678d71acaa6213300dac3c321530589 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 12 Jan 2024 03:51:34 -0800 Subject: don't save settings on error in source editor --- app.lua | 3 ++- main.lua | 1 + source.lua | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app.lua b/app.lua index ac8e709..f59897c 100644 --- a/app.lua +++ b/app.lua @@ -53,7 +53,8 @@ function handle_error(err) App.undo_initialize() App.run_tests_and_initialize() else - if App.disable_tests then App.disable_tests() end + -- abort without running love.quit handler + Disable_all_quit_handlers = true love.event.quit() end end diff --git a/main.lua b/main.lua index 82a8f2d..b40ddf2 100644 --- a/main.lua +++ b/main.lua @@ -331,6 +331,7 @@ function App.wheelmoved(dx,dy) end function love.quit() + if Disable_all_quit_handlers then return end if current_app_is_warning() then return end if Current_app == 'run' then local source_settings = Settings.source diff --git a/source.lua b/source.lua index a4b3603..1aa1f74 100644 --- a/source.lua +++ b/source.lua @@ -271,7 +271,6 @@ function source.settings() if Settings == nil then Settings = {} end if Settings.source == nil then Settings.source = {} end Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position() - App.screen.width, App.screen.height = App.screen.size() File_navigation.cursors[Editor_state.filename] = {cursor1=Editor_state.cursor1, screen_top1=Editor_state.screen_top1} return { x=Settings.source.x, y=Settings.source.y, displayindex=Settings.source.displayindex, -- cgit 1.4.1-2-gfad0