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62K7DVN5F4J46A6A4FE6AMBBCGT2A44L6F34GSTM5EFOTBAC
NSHI3CH54UBZRFBZG2YYXAMCPIQXJQI42TZVC2NMGECEZEPHGO7QC
edit.draw(Editor_state, Text_color) -- populate line_cache.starty for each line Editor_state.line_cache
edit.draw(Editor_state) -- populate line_cache.startpos for each line
edit.draw(Editor_state, Text_color) -- populate line_cache.startpos for each line
edit.draw(Editor_state, Text_color) -- populate line_cache.starty for each line Editor_state.line_cache
edit.draw(Editor_state) -- populate line_cache.startpos for each line
edit.draw(Editor_state, Text_color) -- populate line_cache.startpos for each line
Editor_state.lines = load_array{'abc', 'defgh', 'xyz'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=2, pos=5}
Editor_state.screen_top1 = {line=2, pos=3}
-- press mouse above first line of text
edit.draw(Editor_state, Text_color)
edit.run_after_mouse_press(Editor_state, Editor_state.left+8,5, 1)
-- selection is at screen top
check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
check_eq(Editor_state.selection1.line, 2, 'selection:line')
check_eq(Editor_state.selection1.pos, 3, 'selection:pos')
Editor_state.lines = load_array{'abc', 'defgh', 'xyz'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=2, pos=5}
Editor_state.screen_top1 = {line=2, pos=3}
-- press mouse above first line of text
edit.draw(Editor_state, Text_color)
edit.run_after_mouse_press(Editor_state, Editor_state.left+8,5, 1)
-- selection is at screen top
check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
check_eq(Editor_state.selection1.line, 2, 'selection:line')
check_eq(Editor_state.selection1.pos, 3, 'selection:pos')
-- I'd like to test what happens when a mouse click is below some page of
-- text, potentially even in the middle of a line.
-- However, it's brittle to set up a text line boundary just right.
-- So I'm going to just check things below the bottom of the final line of
-- text when it's in the middle of the screen.
-- final screen line ends in the middle of screen
App.screen.init{width=50, height=60}
Editor_state = edit.initialize_test_state()
Editor_state.lines = load_array{'abcde'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=1, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
-- I'd like to test what happens when a mouse click is below some page of
-- text, potentially even in the middle of a line.
-- However, it's brittle to set up a text line boundary just right.
-- So I'm going to just check things below the bottom of the final line of
-- text when it's in the middle of the screen.
-- final screen line ends in the middle of screen
App.screen.init{width=50, height=60}
Editor_state = edit.initialize_test_state()
Editor_state.lines = load_array{'abcde'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=1, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
edit.draw(Editor_state, Text_color) -- populate line_cache.starty for each line Editor_state.line_cache
edit.draw(Editor_state) -- populate line_cache.startpos for each line
edit.draw(Editor_state, Text_color) -- populate line_cache.startpos for each line
edit.draw(Editor_state, Text_color) -- populate line_cache.starty for each line Editor_state.line_cache
edit.draw(Editor_state) -- populate line_cache.startpos for each line
edit.draw(Editor_state, Text_color) -- populate line_cache.startpos for each line
local stack_trace = debug.traceback('', --[[stack frame]]5) -- most likely to be useful, but set to 0 for a complete stack trace
-- uncomment this line for a complete stack trace