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NTMEGRBQQXYA3HULAKGYOYJP7AC
UV4EWOLYCQ27TL6IGGLKNQX3UUOF7HJ5EJVCZYW345X6BK4J7YQAC
LAW2O3NWVFTPBSKIMIXPAGYBDOCHYJNKCAVWKNKH62G42DIKZCYQC
HOSPP2ANSW654DYRTC6CQUQA2GUKV6T2FI7QBKXD2DZS3R32IMGAC
4VKEE43Z7MUPNIAOCK36INVBNHRTSWRRN37TIKRPXPH3DRKGHHAQC
end
function Text.populate_screen_line_starting_pos(State, line_index)
local line = State.lines[line_index]
if line.mode ~= 'text' then return end
local line_cache = State.line_cache[line_index]
if line_cache.screen_line_starting_pos then
return
end
-- duplicate some logic from Text.draw
if line_cache.fragments == nil then
Text.compute_fragments(State, line_index)
end
line_cache.screen_line_starting_pos = {1}
local x = State.left
local pos = 1
for _, f in ipairs(line_cache.fragments) do
local frag, frag_text = f.data, f.text
-- render fragment
local frag_width = App.width(frag_text)
if x + frag_width > State.right then
x = State.left
table.insert(line_cache.screen_line_starting_pos, pos)
end
x = x + frag_width
local frag_len = utf8.len(frag)
pos = pos + frag_len
end
end
end
function Text.populate_screen_line_starting_pos(State, line_index)
local line = State.lines[line_index]
if line.mode ~= 'text' then return end
local line_cache = State.line_cache[line_index]
if line_cache.screen_line_starting_pos then
return
end
-- duplicate some logic from Text.draw
if line_cache.fragments == nil then
Text.compute_fragments(State, line_index)
end
line_cache.screen_line_starting_pos = {1}
local x = State.left
local pos = 1
for _, f in ipairs(line_cache.fragments) do
local frag, frag_text = f.data, f.text
-- render fragment
local frag_width = App.width(frag_text)
if x + frag_width > State.right then
x = State.left
table.insert(line_cache.screen_line_starting_pos, pos)
end
x = x + frag_width
local frag_len = utf8.len(frag)
pos = pos + frag_len