From c96be4b007177c0232059f3e602784268506c920 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 14 May 2023 17:23:08 -0700 Subject: 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. --- source_text.lua | 1 + text.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/source_text.lua b/source_text.lua index ae5f88c..290d982 100644 --- a/source_text.lua +++ b/source_text.lua @@ -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') diff --git a/text.lua b/text.lua index eadb7c5..b6389e4 100644 --- a/text.lua +++ b/text.lua @@ -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') -- cgit 1.4.1-2-gfad0