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ODRG4NBLH6RXRQZDCHF27BSAC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
--? print('('..s(x)..','..s(y)..') '..frag..'('..s(frag_width)..' vs '..s(right)..') '..s(line_index)..' vs '..s(Editor_state.screen_top1.line)..'; '..s(pos)..' vs '..s(Editor_state.screen_top1.pos)..'; bottom: '..s(Editor_state.screen_bottom1.line)..'/'..s(Editor_state.screen_bottom1.pos))
--? print('('..s(x)..','..s(y)..') '..frag..'('..s(frag_width)..' vs '..s(right)..') '..s(line_index)..' vs '..s(State.screen_top1.line)..'; '..s(pos)..' vs '..s(State.screen_top1.pos)..'; bottom: '..s(State.screen_bottom1.line)..'/'..s(State.screen_bottom1.pos))
if Text.lt1(Editor_state.screen_top1, {line=line_index, pos=pos}) then
y = y + Editor_state.line_height
if y + Editor_state.line_height > App.screen.height then
if Text.lt1(State.screen_top1, {line=line_index, pos=pos}) then
y = y + State.line_height
if y + State.line_height > App.screen.height then
if line_index == Editor_state.cursor1.line then
if pos <= Editor_state.cursor1.pos and pos + frag_len > Editor_state.cursor1.pos then
if Editor_state.search_term then
if Editor_state.lines[Editor_state.cursor1.line].data:sub(Editor_state.cursor1.pos, Editor_state.cursor1.pos+utf8.len(Editor_state.search_term)-1) == Editor_state.search_term then
local lo_px = Text.draw_highlight(line, x,y, pos, Editor_state.cursor1.pos, Editor_state.cursor1.pos+utf8.len(Editor_state.search_term))
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))
if Editor_state.search_term == nil then
if line_index == Editor_state.cursor1.line and Editor_state.cursor1.pos == pos then
Text.draw_cursor(x, y)
if State.search_term == nil then
if line_index == State.cursor1.line and State.cursor1.pos == pos then
Text.draw_cursor(State, x, y)
y, State.screen_bottom1.pos = Text.draw(line, line_index, line.starty, State.margin_left, App.screen.width-State.margin_right)
y, State.screen_bottom1.pos = Text.draw(State, line, line_index, line.starty, State.margin_left, App.screen.width-State.margin_right)