This one was hard until I realized I'm relying more on editor.width, and have to remember to keep it up to date.
IBXNUZM7R2OUGL5TDRF7OUFYY53GTZMEFQ5VJRFQF47P3VWDVDJAC
VHQ3Q2ELIMSM4G3CKJFBYEX7HIDWLIMWASW2VC2AROBDKAM6VTHQC
ZPUIPOBZ5QUJWWI74AOBECEQQN7M7LMJFCKQYBFTFKMYATM46B6QC
HLIF3YQENAUOE4DTSYBCDIRQVWLJ5VPVYC43OC3QP5HSHMCSVP4AC
TEY2M55SZ72OVJ6263EYWFXBHHMR7GPGBNNOGBFIOQPGGHAXSMJQC
TXHMMX25XTR5BQLKHQXIT5TZBFW2KZ54XY3CCL36ZJYJWPKGKC6QC
NJHPKGC4MV6DDRYI4NJEE5LQBSWJBB54QV7EPSOS2ECVI7CBPOJQC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
I64IPGJXWRTGHHVAYJUBUIWFR4BY6NM5P7TLTV4JOD7K4BVYDECQC
V5SYDHPQ7IKNLZZ3NJ24FDW3IG4O23AASLP2DTKOBPWUUZ5KUPOAC
H2DPLWMVRFYTO2CQTG54FMT2LF3B6UKLXH32CUA22DNQJVP5XBNQC
6FM47PAEXXD74ABGEP7AJT7PA3U3SERUAEE6PHJJMBXLKPHLKJSQC
O6JOCPML4QCKJ33RF2SXDHMNH4KF2FA54SQBS7QOJFIWJJPTKBNAC
EDRTD2YKYXX7R4NCJC757JIOVGDVJBQHFC3HYDD2ONDWMPFJOJ6AC
H4R5BHVYKFKF2JOFITQ45VEVW32BOWIMHWFOQ35KAUS6QUI7G5QQC
XUGDTYW2OALZNGX52BJXFYW2IJ6YSXA62ANG2NX2KDWULYAPZYOAC
DHI6IJCNSTHGED67T6H5X6Y636C7PIDGIJD32HBEKLT5WIMRS5MAC
MUJTM6REGQAK3LZTIFWGJRXE2UPCM4HSLXQYSF5ITLXLS6JCVPMQC
GZ2OYPSHZU3FNO5HYP53EABOLM4C3TFPB5RGTIW2CJAWT6D2QXYQC
FZBXBUFFNRE5ZJO5DLRU375HOXT2B7FO35XD7BTHHUXSARVWDFLQC
HALS7E5UGKCP3DFY456F7Z3Y6WNGIABOCV2SHT34D5ZAGNCPV5PQC
Z4XRNDTRTGSZHNB65WNHOVUBFW4QWQABLVSK4RM3QJHGK33DMRJAC
X3F7ECSLGXCH6NBSDIH7LY47I4EG2RR5VFPEMM6ZVDYQIGFID4HQC
GT3XZRTCVBWCSWUXAJ7N4OK2U2G5Y7EGSC5YE76KXZG7C4L53VTQC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
AHEPB6YWWDXRPG2332SBHKPOTV7U4C3LN2MONPICC5DFPLTVXTCAC
RHARLLIQPGKVXNYQSIAZWILUI6F3CWMZ3ABJVI52IC3RBRSWPR5AC
M7UODV5HDRZKAS3BKGLNU5Z5HM4KZDM4QIB2S3E6S7NAWGJY3MJAC
Y5XAFGMWTCVHNO4XQAHN7J2SAMNALDM7TCDGJ56HFRQCTHQ4SQ6AC
SOOY5XYLNNJQSPMYWLFG7D2VIOX4U2U7VPAP7QBBVLHYCIVSMO5AC
C472R5Z2F5ORCBB46YKBEKROI7EBVFDNYBLPMEJDE74M2ZMALIRQC
CINOGX34U6PA3UZ6PXVIHH27KNNNHS26XOYNHPLO236HFQBG6I7QC
KR33DR75FPD3WGIADGWUP6B6JAKZH5Q6OKIHKP4YD4KIVD3TI65QC
if fg then
App.color(fg)
else
select_color(frag)
end
local final_screen_line_starting_pos = startpos -- track value to return
Text.populate_screen_line_starting_pos(State, line_index)
Text.draw_cursor(State, x+Text.x(frag, State.cursor1.pos-pos+1), y, Cursor_color, fg or Text_color)
Text.draw_cursor(State, State.left+Text.x(f, State.cursor1.pos-pos+1), y, Cursor_color, fg)
Text.draw_cursor(State, State.left+Text.x(f, State.cursor1.pos-pos+1), y, Cursor_color, fg or Text_color)