From c87e4a3babdc5fc0b338a549f17266783b4bdecd Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 1 Apr 2023 17:05:57 -0700 Subject: start thinking of compute_fragments as a detail I think all we need to maintain is the populate_screen_line_starting_pos array. It's easy to render screen lines one by one from it, and we'll only ever construct one additional screen line at a time. I'd hoped to delete other calls to Text.populate_screen_line_starting_pos, but it turns out we need to update it when editing sometimes. Give up on that for now; it's a no-op if not needed. --- source_text.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source_text.lua') diff --git a/source_text.lua b/source_text.lua index 3f5ec74..b68bf85 100644 --- a/source_text.lua +++ b/source_text.lua @@ -12,7 +12,7 @@ function Text.draw(State, line_index, y, startpos, hide_cursor) local x = State.left local pos = 1 local screen_line_starting_pos = startpos - Text.compute_fragments(State, line_index) + Text.populate_screen_line_starting_pos(State, line_index) local pos = 1 initialize_color() for _, f in ipairs(line_cache.fragments) do -- cgit 1.4.1-2-gfad0