From ae429cd78a1f52272d5f51991ebb9b04b542ce01 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 17 Mar 2023 21:18:17 -0700 Subject: bring a few things in sync between run and source --- source_edit.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source_edit.lua') diff --git a/source_edit.lua b/source_edit.lua index 5c90075..a296c53 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -96,8 +96,8 @@ function edit.initialize_state(top, left, right, font_height, line_height) -- c em = App.newText(love.graphics.getFont(), 'm'), -- widest possible character width top = top, - left = left, - right = right, + left = math.floor(left), + right = math.floor(right), width = right-left, filename = love.filesystem.getUserDirectory()..'/lines.txt', -- '/' should work even on Windows @@ -227,12 +227,14 @@ function edit.quit(State) -- make sure to save before quitting if State.next_save then save_to_disk(State) + -- give some time for the OS to flush everything to disk + love.timer.sleep(0.1) end end function edit.mouse_press(State, x,y, mouse_button) if State.search_term then return end ---? print('press') +--? print('press', State.selection1.line, State.selection1.pos) if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then -- press on a button and it returned 'true' to short-circuit return -- cgit 1.4.1-2-gfad0