fix a crash

This one isn't worth debugging. We know how to recreate this data on
demand.
This commit is contained in:
Kartik K. Agaram 2022-06-06 18:57:46 -07:00
parent f0e967d2a1
commit f7afc61b22
1 changed files with 3 additions and 1 deletions

View File

@ -674,7 +674,9 @@ function Text.to_pos_on_line(line, mx, my)
if line.screen_line_starting_pos == nil then
return Text.nearest_cursor_pos(line.data, mx)
end
assert(line.fragments)
if line.fragments == nil then
Text.compute_fragments(line, Line_width)
end
assert(my >= line.y)
-- duplicate some logic from Text.draw
local y = line.y