S3COVFLKYP36ODLJR2557QKNFH6UFXWUAOVWT5IJTPRR265LZHHQC
CYJNWUQ5M5HYKZAEW7RUTLE7PRPAMWUKQBZBCQZKCVZVLZDBIWLQC
OAMKQIRSXVKW5ZNOHWZVQ7IT2T3KXRCV3VUJZIEGWKYYT7I323BAC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
JOPVPUSAMMU6RFVDQR4NJC4GNNUFB7GPKVH7OS5FKCYS5QZ53VLQC
HESBC35LBCNFWDFRAO6Z4EJ67BCBHCRETCPEJCV2BDPHUJJFY3WQC
RHMFC6SUIEQTGGDKZYHZQMS4GPK7CQ3C2TVXY756FXJZFKRF6BJAC
QEXZHD2VPCM4TAPP7PR2K2PIR4BVES5IZWC3T6ZRNJWKWOXFILNQC
7VGDIPLCFDG3PVE4JH3WDKZ4A7PG5UYW7TLFFFOWN2JEUZYYTFJQC
YHCEJCSW5PBSC3RPPL6EED7VT46ML55C6VJPFM6OWULR3XD7UV6QC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
OJGPJGGY5IGUVKBOGXHL6EU6M2SU3OICDIX56RILLTDNNQTYB72AC
AF253GHLDMRDMDL5X3OV2UJ5NPKBBMHGH4B3R5IGR35KO6IKYPKQC
L5XCYDKRZJ4WXDEI6IL2RW63B3VRE6NPP5DW4HVU3CHCMCZEFLIAC
or edit.invalid_cursor1(State)
State.cursor1 = {line=1, pos=1}
-- cursor loc in particular differs from other locs in one way:
-- pos might occur just after end of line
function edit.invalid_cursor1(State)
local cursor1 = State.cursor1
if cursor1.line > #State.lines then return true end
local l = State.lines[cursor1.line]
if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
return cursor1.pos > #State.lines[cursor1.line].data + 1
end
if State.cursor1.line >= #State.lines then
break
end
if State.lines[State.cursor1.line].mode == 'text' then
break
end
State.cursor1.line = State.cursor1.line+1
State.cursor1.pos = 1
end
end
function edit.cursor_on_text(State)
return State.cursor1.line <= #State.lines
and State.lines[State.cursor1.line].mode == 'text'
end
edit.put_cursor_on_next_text_line(State)
or not edit.cursor_on_text(State)
or not Text.le1(State.screen_top1, State.cursor1) then
State.screen_top1 = {line=1, pos=1}
end
-- cursor loc in particular differs from other locs in one way:
-- pos might occur just after end of line
function edit.invalid_cursor1(State)
local cursor1 = State.cursor1
if cursor1.line > #State.lines then return true end
local l = State.lines[cursor1.line]
if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
return cursor1.pos > #State.lines[cursor1.line].data + 1
end