Y72J4AZ37PHU3Q2YVE7LV7WAD5L2TVFSIAV3QEOBIYVWKDBQX3SAC
EAEGCJV5JOW46KCZKKPBFKZ4Z3SDB3X4R7TLNXFWCIQN5UCNSXFQC
EGH7XDBKE3R74VXLNTCAP5LJTRBPFUEMPS647MJARDGCMUHJG2QQC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
2RXZ3PGOTTZ6M4R372JXIKPLBQKPVBMAXNPIEO2HZDN4EMYW4GNAC
2ENZW7TVCS47BWCA4AIEVGKGMT4Y2TSM5IJ7O5K2VSWNXIN3SG4QC
AYE2VEGJ63AWWX76SFQZLOTBIZOQRWBG4AZMIOSVOI2WZVRQJXYAC
3OKKTUT4Q7W44JHILOFV5BVUA7ZOBIHBCEXGZ65CPXV4PRLI2W4QC
MP2TBKU6CNDMZKENYMBV62F5KQ27ZWEVPVRFS2RESVDQQT2IRR4AC
return result
end
function Text.to2B(State, loc1)
local result = {line=loc1.line}
Text.populate_screen_line_starting_posB(State, loc1.line)
for i=#State.line_cache[loc1.line].screen_line_starting_posB,1,-1 do
local sposB = State.line_cache[loc1.line].screen_line_starting_posB[i]
if sposB <= loc1.posB then
result.screen_lineB = i
result.screen_posB = loc1.posB - sposB + 1
break
end
end
assert(result.screen_posB)
function Text.eq1(a, b)
return a.line == b.line and a.pos == b.pos
function Text.to1B(State, loc2)
local result = {line=loc2.line, posB=loc2.screen_posB}
if loc2.screen_lineB > 1 then
result.posB = State.line_cache[loc2.line].screen_line_starting_posB[loc2.screen_lineB] + loc2.screen_posB - 1
end
return result