repeat changes on source editor

[?]
Dec 13, 2022, 5:45 PM
KOTNETIMJP2G753SAAQHR5LNOIC7LWLTFSY3QXA276L3TUN63UHQC

Dependencies

  • [2] KMSL74GA support selections in the source editor
  • [3] KKMFQDR4 editing source code from within the app
  • [4] OI4FPFIN support drawings in the source editor

Change contents

  • replacement in source_text_tests.lua at line 270
    [3.13239][3.13239:13399]()
    function test_click_with_mouse()
    io.write('\ntest_click_with_mouse')
    -- display two lines with cursor on one of them
    App.screen.init{width=50, height=80}
    [3.13239]
    [3.13399]
    function test_click_moves_cursor()
    io.write('\ntest_click_moves_cursor')
    App.screen.init{width=50, height=60}
  • replacement in source_text_tests.lua at line 274
    [3.13445][3.13445:13493]()
    Editor_state.lines = load_array{'abc', 'def'}
    [3.13445]
    [3.13493]
    Editor_state.lines = load_array{'abc', 'def', 'xyz'}
  • replacement in source_text_tests.lua at line 276
    [3.13525][3.13525:13566]()
    Editor_state.cursor1 = {line=2, pos=1}
    [3.13525]
    [3.13566]
    Editor_state.cursor1 = {line=1, pos=1}
  • replacement in source_text_tests.lua at line 279
    [3.13646][3.13646:13887](),[3.13887][2.6:129]()
    -- click on the other line
    edit.draw(Editor_state)
    edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)
    -- cursor moves
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_with_mouse/cursor:line')
    check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse/selection is empty to avoid perturbing future edits')
    [3.13646]
    [3.13887]
    Editor_state.selection1 = {}
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    edit.run_after_mouse_release(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_moves_cursor/cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_moves_cursor/cursor:pos')
    -- selection is empty to avoid perturbing future edits
    check_nil(Editor_state.selection1.line, 'F - test_click_moves_cursor/selection:line')
    check_nil(Editor_state.selection1.pos, 'F - test_click_moves_cursor/selection:pos')
  • replacement in source_text_tests.lua at line 289
    [3.13892][3.13892:13995]()
    function test_click_with_mouse_to_left_of_line()
    io.write('\ntest_click_with_mouse_to_left_of_line')
    [3.13892]
    [3.13995]
    function test_click_to_left_of_line()
    io.write('\ntest_click_to_left_of_line')
  • replacement in source_text_tests.lua at line 303
    [3.14506][3.14506:14700](),[3.14700][2.130:269]()
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_with_mouse_to_left_of_line/cursor:line')
    check_eq(Editor_state.cursor1.pos, 1, 'F - test_click_with_mouse_to_left_of_line/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse_to_left_of_line/selection is empty to avoid perturbing future edits')
    [3.14506]
    [3.14700]
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_to_left_of_line/cursor:line')
    check_eq(Editor_state.cursor1.pos, 1, 'F - test_click_to_left_of_line/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_click_to_left_of_line/selection is empty to avoid perturbing future edits')
  • replacement in source_text_tests.lua at line 308
    [3.14705][3.14705:14830]()
    function test_click_with_mouse_takes_margins_into_account()
    io.write('\ntest_click_with_mouse_takes_margins_into_account')
    [3.14705]
    [3.14830]
    function test_click_takes_margins_into_account()
    io.write('\ntest_click_takes_margins_into_account')
  • replacement in source_text_tests.lua at line 323
    [3.15388][3.15388:15604](),[3.15604][2.270:420]()
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_with_mouse_takes_margins_into_account/cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_with_mouse_takes_margins_into_account/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse_takes_margins_into_account/selection is empty to avoid perturbing future edits')
    [3.15388]
    [3.15604]
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_takes_margins_into_account/cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_takes_margins_into_account/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_click_takes_margins_into_account/selection is empty to avoid perturbing future edits')
  • replacement in source_text_tests.lua at line 328
    [3.15609][3.15609:15708]()
    function test_click_with_mouse_on_empty_line()
    io.write('\ntest_click_with_mouse_on_empty_line')
    [3.15609]
    [3.15708]
    function test_click_on_empty_line()
    io.write('\ntest_click_on_empty_line')
  • replacement in source_text_tests.lua at line 342
    [3.16198][3.16198:16289]()
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_with_mouse_on_empty_line/cursor')
    [3.16198]
    [3.16289]
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_on_empty_line/cursor')
  • replacement in source_text_tests.lua at line 399
    [3.18394][3.18394:18499]()
    function test_click_with_mouse_on_wrapping_line()
    io.write('\ntest_click_with_mouse_on_wrapping_line')
    [3.18394]
    [3.18499]
    function test_click_on_wrapping_line()
    io.write('\ntest_click_on_wrapping_line')
  • replacement in source_text_tests.lua at line 413
    [3.19012][3.19012:19208](),[3.19208][2.421:561]()
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_with_mouse_on_wrapping_line/cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_with_mouse_on_wrapping_line/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse_on_wrapping_line/selection is empty to avoid perturbing future edits')
    [3.19012]
    [3.19208]
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_on_wrapping_line/cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_on_wrapping_line/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_click_on_wrapping_line/selection is empty to avoid perturbing future edits')
  • replacement in source_text_tests.lua at line 418
    [3.19213][3.19213:19372]()
    function test_click_with_mouse_on_wrapping_line_takes_margins_into_account()
    io.write('\ntest_click_with_mouse_on_wrapping_line_takes_margins_into_account')
    [3.19213]
    [3.19372]
    function test_click_on_wrapping_line_takes_margins_into_account()
    io.write('\ntest_click_on_wrapping_line_takes_margins_into_account')
  • replacement in source_text_tests.lua at line 433
    [3.19948][3.19948:20198](),[3.20198][2.562:729]()
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_with_mouse_on_wrapping_line_takes_margins_into_account/cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_with_mouse_on_wrapping_line_takes_margins_into_account/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse_on_wrapping_line_takes_margins_into_account/selection is empty to avoid perturbing future edits')
    [3.19948]
    [3.20198]
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_on_wrapping_line_takes_margins_into_account/cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_on_wrapping_line_takes_margins_into_account/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_click_on_wrapping_line_takes_margins_into_account/selection is empty to avoid perturbing future edits')
  • edit in source_text_tests.lua at line 858
    [3.32393][3.32393:32776](),[3.32776][2.7717:7748](),[2.7748][3.32776:32871](),[3.32776][3.32776:32871](),[3.32871][2.7749:7837](),[2.7837][3.32957:33133](),[3.32957][3.32957:33133](),[3.33133][2.7838:8022]()
    end
    function test_move_cursor_using_mouse()
    io.write('\ntest_move_cursor_using_mouse')
    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
    edit.run_after_mouse_release(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)
    check_eq(Editor_state.cursor1.line, 1, 'F - test_move_cursor_using_mouse/cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_move_cursor_using_mouse/cursor:pos')
    check_nil(Editor_state.selection1.line, 'F - test_move_cursor_using_mouse/selection:line')
    check_nil(Editor_state.selection1.pos, 'F - test_move_cursor_using_mouse/selection:pos')