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lines
-- update y only after drawing the first screen line of screen top
if Text.lt1(State.screen_top1, {line=line_index, pos=pos}) then
if Text.lt1({line=line_index, pos=pos}, State.screen_top1) then
-- render nothing
--? print('skipping', frag)
else
if x + frag_width > State.right then
assert(x > State.left) -- no overfull lines
x = State.left
end
--? print('checking to draw', pos, State.screen_top1.pos)
-- don't draw text above screen top
if Text.le1(State.screen_top1, {line=line_index, pos=pos}) then
end
-- render cursor if necessary
if line_index == State.cursor1.line then
if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
if State.search_term then
if State.lines[State.cursor1.line].data:sub(State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term)-1) == State.search_term then
local lo_px = Text.draw_highlight(line, x,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))
App.color(Text_color)
love.graphics.print(State.search_term, x+lo_px,y)
-- render cursor if necessary
if line_index == State.cursor1.line then
if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
if State.search_term then
if State.lines[State.cursor1.line].data:sub(State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term)-1) == State.search_term then
local lo_px = Text.draw_highlight(line, x,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))
App.color(Text_color)
love.graphics.print(State.search_term, x+lo_px,y)
end
else
Text.draw_cursor(State, x+Text.x(frag, State.cursor1.pos-pos+1), y)