resolve conflicts

akkartik
Oct 30, 2024, 1:25 AM
QSHQIVF3JASUFN56WXNZRZW2CQAZXB2V43YQJVBZ3FPRTVULZJ6QC

Dependencies

Change contents

  • file deletion: source_text_tests.lua (----------)source_text_tests.lua (----------)
    [4.2][4.83739:83784](),[4.2][4.83739:83784](),[4.83784][4.3561:3561]()
    end
    function test_search_downwards_from_end_of_line()
    App.screen.init{width=120, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc', 'def', 'ghi'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=4}
    Editor_state.screen_top1 = {line=1, pos=1}
    edit.draw(Editor_state)
    -- search for empty string
    edit.run_after_keychord(Editor_state, 'C-f', 'f')
    edit.run_after_keychord(Editor_state, 'down', 'down')
    -- no crash
    end
    function test_search_downwards_from_final_pos_of_line()
    App.screen.init{width=120, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc', 'def', 'ghi'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=3}
    Editor_state.screen_top1 = {line=1, pos=1}
    edit.draw(Editor_state)
    -- search for empty string
    edit.run_after_keychord(Editor_state, 'C-f', 'f')
    edit.run_after_keychord(Editor_state, 'down', 'down')
    -- no crash
    end
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [4.2][4.165788:165827](),[4.2][4.165788:165827](),[4.165827][4.152503:152503]()
    local line = State.cursor1.line
    while line < #State.lines do
    line = line+1
    if State.lines[line].mode == 'text' then
    State.cursor1.line = line
    State.cursor1.pos = 1
    end
    end
    function edit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State)
    local line = State.cursor1.line
    local max = #State.lines
    for _ = 1, max-1 do
    line = (line+1) % max
    if State.lines[line].mode == 'text' then
    State.cursor1.line = line
    State.cursor1.pos = 1
    end
    end
    function edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)
    local cursor_line = State.lines[State.cursor1.line].data
    if State.cursor1.pos <= utf8.len(cursor_line) then
    State.cursor1.pos = State.cursor1.pos + 1
    else
    edit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State)
    State.cursor = deepcopy(State.search_backup.cursor)
    State.screen_top = deepcopy(State.search_backup.screen_top)
    elseif chord == 'down' then
    if #State.search_term > 0 then
    edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)
    Text.search_next(State)
    end
    elseif chord == 'up' then
    Text.search_previous(State)
    end
    return
    elseif chord == 'C-f' then
    State.search_term = ''
    State.search_backup = {
    Text.search_next(State)
    end
    end
    break
    end
    break
    end