GC2EXJUFGAKWF2KWW6LF7OB2FAFGTBJPHFH667AAR35MP2GFQA2AC
CZCX6BWQC74E4SDA3BYE4LFTVQTJX5AUBYFKTUSK44H6EMVNL57QC
AFTQVKJAKZLGSUBOZOMBLXOEGSFZDBT4WOAZGGSA6ETRJCFZNFKQC
F5KCYFOYPMHBNSPS2G6IF3HCSHABOSWQVM3Z7BZKHZ36TJBVJ5GQC
JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
O7YTBRQYVEM6LR22BJFPAGGF4CQP5R2C4B4KXVOTHUWA32TVZ6BQC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
IENTL2ITG2CJE5TRUJGUE65CNC4COAQIQGDMGETZCP5R2VUMS7QQC
if State.lines[line].mode == 'text' then
State.cursor1.line = line
State.cursor1.pos = 1
break
end
end
end
function edit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State)
local line = State.cursor1.line
local max = #State.lines
for _ = 1, max-1 do
line = (line+1) % max
if State.lines[line].mode == 'text' then
State.cursor1.line = line
State.cursor1.pos = 1
break
end
end
end
function edit.final_cursor(State)
for i=#State.lines,1,-1 do
if State.lines[i].mode == 'text' then
return {line=i, pos=utf8.len(State.lines[i].data)+1}
end
end
end
function edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)
local cursor_line = State.lines[State.cursor1.line].data
if State.cursor1.pos <= utf8.len(cursor_line) then
State.cursor1.pos = State.cursor1.pos + 1
else
edit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State)