add an assert

I added this to catch a rare bug. I've had it locally for a few weeks
now without hitting it. Doesn't hurt to publish it.
This commit is contained in:
Kartik K. Agaram 2023-05-14 17:23:08 -07:00
parent 47730a2b33
commit c96be4b007
2 changed files with 2 additions and 0 deletions

View File

@ -486,6 +486,7 @@ end
function Text.down(State)
assert(State.lines[State.cursor1.line].mode == 'text')
--? print('down', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
assert(State.cursor1.pos)
if Text.cursor_at_final_screen_line(State) then
-- line is done, skip to next text line
--? print('cursor at final screen line of its line')

View File

@ -427,6 +427,7 @@ end
function Text.down(State)
assert(State.lines[State.cursor1.line].mode == 'text')
--? print('down', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
assert(State.cursor1.pos)
if Text.cursor_at_final_screen_line(State) then
-- line is done, skip to next text line
--? print('cursor at final screen line of its line')