PZ3H5QQIQT2OVT3O3GQJOTCB6KWFF5TUETKVXWIQK57FSNFZTKWQC
4MJNONO5GTRG5WNBTP7AADBEAPZF2FHNFT76NNDV3R5L6L3EJTRQC
NVPHFDXGQ7ORFKN3UUO3RUATDBPU465XQZ2BHR3XMCN4RLM3X6YAC
3YZEZM2HL4TMITYHOA46J7SJNCX7NRHFMREMFM23TP5QK5CDPZEQC
HALS7E5UGKCP3DFY456F7Z3Y6WNGIABOCV2SHT34D5ZAGNCPV5PQC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
HALQLPZNGJTWL3XZVV2YLCUHMK33PNMWXMADBHIKEOSLI3PQMULQC
BSFCJ4VL2TUG6EKDKBDM6TSJDRQJDEE6SJJLOQ3V5EMWAIK6BP4QC
MUJTM6REGQAK3LZTIFWGJRXE2UPCM4HSLXQYSF5ITLXLS6JCVPMQC
M5C7KFGEWP2YR5HYIVYWE4GJ4PUE6ZSDMOGQUDH7BVHJNYK53RAAC
FZBXBUFFNRE5ZJO5DLRU375HOXT2B7FO35XD7BTHHUXSARVWDFLQC
NN4OMV27GQ6ZUV7WHR4ZKVT2HHPQVDVSHLC4CVY4ZYCX3F6SHTOAC
I64IPGJXWRTGHHVAYJUBUIWFR4BY6NM5P7TLTV4JOD7K4BVYDECQC
PHWEOV6NI6C4JEUJIHNC7OIUNEXCBJ3FODJUL6UUBI53GGMS3GTAC
BJDFHWEJVL6OMKVMSRXOGBFEMAFOMFS2RWRQXPVCCMDLEPYKA25AC
Z4XRNDTRTGSZHNB65WNHOVUBFW4QWQABLVSK4RM3QJHGK33DMRJAC
PLKNHYZ4KXWWKC2DHXCI4WVO23I7VMEVYT5H2J6JDE4S3D3CHDJQC
LGEY6A426OSCYPR5Y656VSVESXDTY73BBGHFPGLGOSTCUXKOIQIQC
local data = State.lines[State.cursor1.line].data
local cursor_offset = Text.offset(data, State.cursor1.pos)
if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term then
local lo_px = Text.draw_highlight(State, line, State.left,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))
App.color(fg)
love.graphics.print(State.search_term, State.left+lo_px,y)
if State.search_term then
local data = State.lines[State.cursor1.line].data
local cursor_offset = Text.offset(data, State.cursor1.pos)
if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term then
local save_selection = State.selection1
State.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
elseif hide_cursor then
Text.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
else
Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)
end
else
if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
if hide_cursor then
Text.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
else
Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)
end
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.
if hide_cursor then
Text.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
else
Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)
end
end
else
if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
Text.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.