6RYLD5ONDIQFWU5CNL4NGHJQ2LNAZZFGTPXQJDNJGLNYAUOTUI7QC
GNKUD23IHHTLV6COIR4LBK36GPN2FPBGSXHOSJHRW5KKEA2ENWUAC
LXTTOB33N2HCUZFIUDRQGGBVHK2HODRG4NBLH6RXRQZDCHF27BSAC
KOTI3MFGQ4PDS4I75JIJG734LTET6745VGTSMNFYYASVIO6H2KPAC
ORRSP7FVCHI2TF5GXBRGQYYJAA3JFYXZBM3T663BKSBV22FCZVCAC
WAR3HXHTN7JZVV6TFMU2F3QYAG6NDH7DN7KKPTM2ICEHRNQYP6PAC
7RKFA3VAGK73SLC3NCOKHVMOWLTC4EUQYS47P3LVVKDVLBVGBEHAC
MXA3RZYKUI4UF2ISY7JEF6VKX6NOPZMZH5SLLCZHRJKFIXXXDPSAC
S2MISTTMPEULTO6WRO4Q4NRUO7XC2PTZW3UBR7K7SO6JPZO6HBHAC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
LNUHQOGHIOFGJXNGA3DZLYEASLYYDGLN2I3EDZY5ANASQAHCG3YQC
4EGQRXDANFLUYXADP3MNHZWP2LBH2P5VBVKNN5RT6ERGMBVSRI2AC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
end
function test_select_text_using_mouse_starting_above_text()
App.screen.init{width=50, height=60}
Editor_state = edit.initialize_test_state()
Editor_state.lines = load_array{'abc', 'def', 'xyz'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=1, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
Editor_state.selection1 = {}
edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
-- press mouse above first line of text
edit.run_after_mouse_press(Editor_state, Editor_state.left+8,5, 1)
check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
check_eq(Editor_state.selection1.line, 1, 'selection:line')
check_eq(Editor_state.selection1.pos, 1, 'selection:pos')
--? function test_select_all_text_then_mouse_press_outside_text()
--? -- display a single line of text
--? App.screen.init{width=75, height=80}
--? Editor_state = edit.initialize_test_state()
--? Editor_state.lines = load_array{'abc def'}
--? Text.redraw_all(Editor_state)
--? Editor_state.cursor1 = {line=1, pos=1}
--? Editor_state.screen_top1 = {line=1, pos=1}
--? Editor_state.screen_bottom1 = {}
--? edit.draw(Editor_state)
--? -- select all
--? App.fake_key_press('lctrl')
--? edit.run_after_keychord(Editor_state, 'C-a')
--? App.fake_key_release('lctrl')
--? edit.key_release(Editor_state, 'lctrl')
--? -- selection
--? check_eq(Editor_state.selection1.line, 1, 'selection:line')
--? check_eq(Editor_state.selection1.pos, 1, 'selection:pos')
--? check_eq(Editor_state.cursor1.line, 1, 'cursor:line')
--? check_eq(Editor_state.cursor1.pos, 8, 'cursor:pos')
--? -- part of a mouse click outside the selected line
--? edit.run_after_mouse_press(Editor_state, 45, Margin_top + Editor_state.line_height + 10, --[[mouse button]] 1)
--? end