PRYVVWOS47BUSXKAROAKMCOBAU7J4344YR5EOACFLIUL2JKBMVCQC
end
elseif State.cursor1.posB then
-- move down one screen line (B side) in current line
local scroll_down = false
if Text.le1(State.screen_bottom1, State.cursor1) then
scroll_down = true
end
local cursor_line = State.lines[State.cursor1.line]
local cursor_line_cache = State.line_cache[State.cursor1.line]
local cursor2 = Text.to2(State, State.cursor1)
assert(cursor2.screen_lineB < #cursor_line_cache.screen_line_starting_posB)
local screen_line_starting_posB, screen_line_indexB = Text.pos_at_start_of_cursor_screen_lineB(State)
new_screen_line_starting_posB = cursor_line_cache.screen_line_starting_posB[screen_line_indexB+1]
local new_screen_line_starting_byte_offsetB = Text.offset(cursor_line.dataB, new_screen_line_starting_posB)
local s = string.sub(cursor_line.dataB, new_screen_line_starting_byte_offsetB)
State.cursor1.posB = new_screen_line_starting_posB + Text.nearest_cursor_pos(s, State.cursor_x, State.left) - 1
if scroll_down then
Text.snap_cursor_to_bottom_of_screen(State)
end
else
-- move down one screen line (B side) in current line
local scroll_down = false
if Text.le1(State.screen_bottom1, State.cursor1) then
scroll_down = true
end
local cursor_line = State.lines[State.cursor1.line]
local cursor_line_cache = State.line_cache[State.cursor1.line]
local cursor2 = Text.to2(State, State.cursor1)
assert(cursor2.screen_lineB < #cursor_line_cache.screen_line_starting_posB)
local screen_line_starting_posB, screen_line_indexB = Text.pos_at_start_of_cursor_screen_lineB(State)
new_screen_line_starting_posB = cursor_line_cache.screen_line_starting_posB[screen_line_indexB+1]
local new_screen_line_starting_byte_offsetB = Text.offset(cursor_line.dataB, new_screen_line_starting_posB)
local s = string.sub(cursor_line.dataB, new_screen_line_starting_byte_offsetB)
State.cursor1.posB = new_screen_line_starting_posB + Text.nearest_cursor_pos(s, State.cursor_x, State.left) - 1
if scroll_down then
Text.snap_cursor_to_bottom_of_screen(State)