34JRMRW62LYYHX3SC3E6RUXARUUEGPZ3N5B4Q43ZQIMXGH7CCVZQC LHC67SBIPNAAY2DPKRLUML7UKLIHP4EOXJKW37TEGU3PSPXXUUSAC CGPUJ65Q5PZ4LNMDGIQZSR6W5O7H5WLW6ZPAS52FHP7KL433OTMQC BMGHJX7GIX535K2DU7ZT4EP2O6MYS7QVING22AAJABUY53K2PLFAC HALS7E5UGKCP3DFY456F7Z3Y6WNGIABOCV2SHT34D5ZAGNCPV5PQC BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC TWXPV2AC7EK2XKGQCYJLRV6QWPGIWMOZOVPMWJXONRUTROO5QW3QC PLKNHYZ4KXWWKC2DHXCI4WVO23I7VMEVYT5H2J6JDE4S3D3CHDJQC IM7UEBMKYG6UT2MS34ZUVM5ZLN5YUZXOHJ6GVUSFMHRAK3JKULBQC 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_selectionendelseif pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos thenText.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)elseif pos + frag_len == State.cursor1.pos then-- Keep pretend cursor_x/cursor_y in sync with upstream.
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_selectionendelseif 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.