about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-04-01 17:05:57 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-04-01 18:12:29 -0700
commitc87e4a3babdc5fc0b338a549f17266783b4bdecd (patch)
tree8296376f8a66c3b36bb37e6118c86e79b540b7c5 /text.lua
parent24a732ebff281dd2dee5f906b4b949315cdd018f (diff)
downloadview.love-c87e4a3babdc5fc0b338a549f17266783b4bdecd.tar.gz
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.
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/text.lua b/text.lua
index cc9dcb7..0dcd607 100644
--- a/text.lua
+++ b/text.lua
@@ -12,7 +12,7 @@ function Text.draw(State, line_index, y, startpos)
   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)
   for _, f in ipairs(line_cache.fragments) do
     App.color(Text_color)
     local frag_len = utf8.len(f)