resolve conflicts

akkartik
Oct 30, 2024, 1:16 AM
S7CSVBHZ4AORIP4VIQETFAVXVMNKERVOI5DENNTU73ZO2L667N7QC

Dependencies

Change contents

  • file deletion: source_text_tests.lua (----------)source_text_tests.lua (----------)
    [4.2][4.83676:83721](),[4.2][4.83676:83721](),[4.83721][4.3498:3498]()
    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
    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}
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [4.2][4.165725:165764](),[4.2][4.165725:165764](),[4.165764][4.152440:152440]()
    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)
    Text.search_next(State)
    if #State.search_term > 0 then
    edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)
    Text.search_next(State)
    end
    Text.search_previous(State)
    end
    return
    elseif chord == 'C-f' then
    State.search_term = ''
    State.search_backup = {
    elseif chord == 'up' then
    elseif chord == 'down' then
    end
    break
    end
    break
    end
  • edit in source_text_tests.lua at line 2075
    [4.791]
    [4.83734]
    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
  • replacement in source_edit.lua at line 145
    [4.438][4.438:454](),[4.454][4.516:563]()
    while true do
    if State.cursor1.line >= #State.lines then
    [4.438]
    [4.563]
    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
  • replacement in source_edit.lua at line 153
    [4.583][4.583:642]()
    if State.lines[State.cursor1.line].mode == 'text' then
    [4.583]
    [4.642]
    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
  • replacement in source_edit.lua at line 166
    [4.662][4.662:734]()
    State.cursor1.line = State.cursor1.line+1
    State.cursor1.pos = 1
    [4.662]
    [4.18427]
    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)
  • replacement in source_edit.lua at line 431
    [4.158937][4.158937:158969](),[4.158969][4.9367:9413]()
    elseif chord == 'down' then
    State.cursor1.pos = State.cursor1.pos+1
    [4.158907]
    [4.159120]
    State.cursor = deepcopy(State.search_backup.cursor)
    State.screen_top = deepcopy(State.search_backup.screen_top)
  • edit in source_edit.lua at line 434
    [4.159150]
    [4.159150]
    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
  • edit in edit.lua at line 98
    [4.754]
    [4.29]
    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
    break
    end
    end
    end
    function edit.put_cursor_on_next_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)
    end
  • replacement in edit.lua at line 308
    [4.6797][4.6797:6873]()
    State.cursor1.pos = State.cursor1.pos+1
    Text.search_next(State)
    [4.6797]
    [4.6873]
    if #State.search_term > 0 then
    edit.put_cursor_on_next_loc_wrapping_around_if_necessary(State)
    Text.search_next(State)
    end
  • edit in edit.lua at line 469
    [4.12430][2.429:429](),[4.394][4.2561:2889](),[4.394][4.2561:2889](),[4.394][4.2561:2889](),[4.315][4.2256:2560](),[4.315][4.2256:2560](),[4.441][4.2067:2255](),[4.441][4.2067:2255](),[4.441][4.2067:2255](),[4.11621][3.35:191](),[4.11621][3.35:191](),[4.11710][4.198:232](),[4.11710][4.198:232]()
    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)
    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
    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
    if #State.search_term > 0 then
    edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)
    Text.search_next(State)
    end
    Text.search_previous(State)
  • resolve order conflict in edit.lua at line 469
    [4.12430]