I'm duplicating the bounds check when drawing cursor and search highlight because they're separate concerns and require subtly different logic.
TWXPV2AC7EK2XKGQCYJLRV6QWPGIWMOZOVPMWJXONRUTROO5QW3QC
ZPQI5UL3V6QIZXWGXO2DZOCCTLIUOQSRP3LIQKEARIQQSNA6RO6AC
ZE7LVQNETLPF64M4JJTIVVIKZVNIE2CDKGVQH3ZNJRTNDRID55YQC
I64IPGJXWRTGHHVAYJUBUIWFR4BY6NM5P7TLTV4JOD7K4BVYDECQC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
HALS7E5UGKCP3DFY456F7Z3Y6WNGIABOCV2SHT34D5ZAGNCPV5PQC
SDEY7LFJ4LY735OZAJ6X5Y2SE3MFBT4X4TWLHVW3SS2JAK757E6QC
GZ5WULJVEZJJQPQPSQZE7CEPIYPJ2BJDYUJBMZRA5HLOO7TE3DOQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then
if State.search_term then
if State.search_term then
if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then
if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then
if State.search_term then
if State.search_term then
if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then