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7JQ4VQC JOPVPUSAMMU6RFVDQR4NJC4GNNUFB7GPKVH7OS5FKCYS5QZ53VLQC D4B52CQ2QKG2HQKFUQOO5S2ME325DTW3PH2D7SBXCW4BPQFYG7CAC end-- render colorized textlocal x = State.leftfor frag in screen_line:gmatch('%S*%s*') doselect_color(frag)App.screen.print(frag, x,y)x = x+App.width(frag)end-- render search highlight or cursorif State.search_term thenendelseif Focus == 'edit' thenif pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos thenText.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)elseif pos + frag_len == State.cursor1.pos then-- Show cursor at end of line.-- This place also catches end of wrapping screen lines. That doesn't seem worth distinguishing.-- It seems useful to see a cursor whether your eye is on the left or right margin.Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)local data = State.lines[State.cursor1.line].datalocal cursor_offset = Text.offset(data, State.cursor1.pos)if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term thenlocal save_selection = State.selection1State.selection1 = {line=line_index, pos=State.cursor1.pos+utf8.len(State.search_term)}local lo, hi = Text.clip_selection(State, line_index, pos, pos+frag_len)Text.draw_highlight(State, line, State.left,y, pos, lo,hi)State.selection1 = save_selection
if not hide_cursor and line_index == State.cursor1.line then-- render search highlight or cursorif State.search_term thenlocal data = State.lines[State.cursor1.line].datalocal cursor_offset = Text.offset(data, State.cursor1.pos)if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term thenlocal save_selection = State.selection1State.selection1 = {line=line_index, pos=State.cursor1.pos+utf8.len(State.search_term)}local lo, hi = Text.clip_selection(State, line_index, pos, pos+frag_len)Text.draw_highlight(State, line, State.left,y, pos, lo,hi)State.selection1 = save_selectionendelseif Focus == 'edit' thenif pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos thenText.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)elseif pos + frag_len == State.cursor1.pos then-- Show cursor at end of line.-- This place also catches end of wrapping screen lines. That doesn't seem worth distinguishing.-- It seems useful to see a cursor whether your eye is on the left or right margin.Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)endendend
-- render cursor if necessaryif not hide_cursor and line_index == State.cursor1.line thenif pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos thenif State.search_term thenlocal data = State.lines[State.cursor1.line].datalocal cursor_offset = Text.offset(data, State.cursor1.pos)if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term thenlocal lo_px = Text.draw_highlight(State, line, State.left,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))App.color(Text_color)love.graphics.print(State.search_term, State.left+lo_px,y)endelseif Focus == 'edit' thenText.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)endendend