about summary refs log tree commit diff stats
path: root/app.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-06-11 06:58:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2024-06-11 07:02:46 -0700
commitf2299cb422d0fc07a1b01f0c31f88e9ae5ab168f (patch)
tree1216103a49bdba04dbcad0f35f14ee3128e51a9c /app.lua
parent19615eade0106ad5a3a988b3f1f257367aceb7ec (diff)
downloadview.love-f2299cb422d0fc07a1b01f0c31f88e9ae5ab168f.tar.gz
stop caching screen_bottom1
I'm not sure this is very useful. I had an initial idea to stop using
screen_bottom1 in final_text_loc_on_screen, by starting from screen_top1
rather than screen_bottom1. But that changes the direction in which we
scan for the text line in situations where there is somehow no text on
screen (something that should never happen but I have zero confidence in
that).

Still, it doesn't seem like a bad thing to drastically reduce the
lifetime of some derived state.

Really what I need to do is throw this whole UX out and allow the cursor
to be on a drawing as a whole. So up arrow or left arrow below a drawing
would focus the whole drawing in a red border, and another up arrow and
left arrow would skip the drawing and continue upward. I think that
change to the UX will eliminate a whole class of special cases in the
code.
Diffstat (limited to 'app.lua')
-rw-r--r--app.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/app.lua b/app.lua
index 627a438..5e61d47 100644
--- a/app.lua
+++ b/app.lua
@@ -130,6 +130,8 @@ function App.run_tests()
     end
   end
   table.sort(sorted_names)
+--?   App.initialize_for_test() -- debug: run a single test at a time like these 2 lines
+--?   test_pagedown_skips_drawings()
   for _,name in ipairs(sorted_names) do
     App.initialize_for_test()
 --?     print('=== '..name)
@@ -404,9 +406,10 @@ end
 -- prepend file/line/test
 function prepend_debug_info_to_test_failure(test_name, err)
   local err_without_line_number = err:gsub('^[^:]*:[^:]*: ', '')
-  local stack_trace = debug.traceback('', --[[stack frame]]5)
+  local stack_trace = debug.traceback('', --[[stack frame]]5)  -- most likely to be useful, but set to 0 for a complete stack trace
   local file_and_line_number = stack_trace:gsub('stack traceback:\n', ''):gsub(': .*', '')
   local full_error = file_and_line_number..':'..test_name..' -- '..err_without_line_number
+  -- uncomment this line for a complete stack trace
 --?   local full_error = file_and_line_number..':'..test_name..' -- '..err_without_line_number..'\t\t'..stack_trace:gsub('\n', '\n\t\t')
   table.insert(Test_errors, full_error)
 end