62JEPVQ34SOTQI6VQNLGLKS5O4KFU52UKAVDHN6N7G5T6Z5EZO5QC
JJDT2X4FKYC5I3CPTV4PNOALPFXQNG2SSLZJ36QFZIBUXY2ZAXXAC
LF7BWEG4DKQI7NMXMZC4LC2BE5PB42HK5PD6OYBNIDMAZBJASOKQC
DSLD74DK3P6J2VAFCYF5BGTHZ637QTW3PDHOUHFACDZU66YNM3IAC
LXTTOB33N2HCUZFIUDRQGGBVHK2HODRG4NBLH6RXRQZDCHF27BSAC
HMODUNJEQLZ3W46GKYIDL55F6COVXHTIC6UW4AK3SXOOKOPE6NNAC
SPSW74Y5OJ54Y7VQ3SJFCJR5CYDKTR4A3TOEVZODDZLUSDDU2GZAC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
end
function test_backspace_from_start_of_final_line()
io.write('\ntest_backspace_from_start_of_final_line')
-- display final line of text with cursor at start of it
App.screen.init{width=120, height=60}
Editor_state = edit.initialize_test_state()
Editor_state.lines = load_array{'abc', 'def'}
Editor_state.screen_top1 = {line=2, pos=1}
Editor_state.cursor1 = {line=2, pos=1}
Text.redraw_all(Editor_state)
-- backspace scrolls up
edit.run_after_keychord(Editor_state, 'backspace')
check_eq(#Editor_state.lines, 1, 'F - test_backspace_from_start_of_final_line/#lines')
check_eq(Editor_state.cursor1.line, 1, 'F - test_backspace_from_start_of_final_line/cursor')
check_eq(Editor_state.screen_top1.line, 1, 'F - test_backspace_from_start_of_final_line/screen_top')
if Text.lt1(State.cursor1, State.screen_top1) then
if State.screen_top1.line > #State.lines then
Text.populate_screen_line_starting_pos(State, #State.lines)
local line_cache = State.line_cache[#State.line_cache]
State.screen_top1 = {line=#State.lines, pos=line_cache.screen_line_starting_pos[#line_cache.screen_line_starting_pos]}
elseif Text.lt1(State.cursor1, State.screen_top1) then