KECEMMMRW2VVBZ567HJQPGLC57LTSBKWH7UFP32IW43D23X6WTEQC
MDXGMZU2MBEDMTB755D3RRYEFKF54GTTYTI5XJYKKKN5ZFQWZXTAC
XNFTJHC4QSHNSIWNN7K6QZEZ37GTQYKHS4EPNSVPQCUSWREROGIQC
2RXZ3PGOTTZ6M4R372JXIKPLBQKPVBMAXNPIEO2HZDN4EMYW4GNAC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
DAENUOGV7KR6MZVXS36HEN3SZC4RFIS6REGAFVBOFEPO76EUDGIAC
DLQMM2656JHXX3ONOEM6UIOXKFJFT5QT7RHWK7YS2W77PVZWHRSAC
SVJZZDC3K6AKAXHGRNAZKRE2ZXEKJANNLG7LSSUZJARFBL5F7C4AC
assert(Lines[Cursor1.line].mode == 'text')
if Cursor1.pos > 1 then
Cursor1.pos = Cursor1.pos-1
else
local new_cursor_line = Cursor1.line
while new_cursor_line > 1 do
new_cursor_line = new_cursor_line-1
if Lines[new_cursor_line].mode == 'text' then
Cursor1.line = new_cursor_line
Cursor1.pos = utf8.len(Lines[Cursor1.line].data) + 1
break
end
end
if Cursor1.line < Screen_top1.line then
Screen_top1.line = Cursor1.line
end
end
Text.left()
assert(Lines[Cursor1.line].mode == 'text')
if Cursor1.pos <= utf8.len(Lines[Cursor1.line].data) then
Cursor1.pos = Cursor1.pos+1
else
local new_cursor_line = Cursor1.line
while new_cursor_line <= #Lines-1 do
new_cursor_line = new_cursor_line+1
if Lines[new_cursor_line].mode == 'text' then
Cursor1.line = new_cursor_line
Cursor1.pos = 1
break
end
end
if Cursor1.line > Screen_bottom1.line then
Screen_top1.line = Cursor1.line
end
end
Text.right()
end
end
function Text.left()
assert(Lines[Cursor1.line].mode == 'text')
if Cursor1.pos > 1 then
Cursor1.pos = Cursor1.pos-1
else
local new_cursor_line = Cursor1.line
while new_cursor_line > 1 do
new_cursor_line = new_cursor_line-1
if Lines[new_cursor_line].mode == 'text' then
Cursor1.line = new_cursor_line
Cursor1.pos = utf8.len(Lines[Cursor1.line].data) + 1
break
end
end
if Cursor1.line < Screen_top1.line then
Screen_top1.line = Cursor1.line
end
end
end
function Text.right()
assert(Lines[Cursor1.line].mode == 'text')
if Cursor1.pos <= utf8.len(Lines[Cursor1.line].data) then
Cursor1.pos = Cursor1.pos+1
else
local new_cursor_line = Cursor1.line
while new_cursor_line <= #Lines-1 do
new_cursor_line = new_cursor_line+1
if Lines[new_cursor_line].mode == 'text' then
Cursor1.line = new_cursor_line
Cursor1.pos = 1
break
end
end
if Cursor1.line > Screen_bottom1.line then
Screen_top1.line = Cursor1.line
end