diff --git a/src/controller.cpp b/src/controller.cpp index 85c9820..bd7a7e0 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -115,7 +115,7 @@ void Controller::start_action_engine() { continue; } else if (k.value() == rawterm::Key('D', rawterm::Mod::Arrow)) { - parse_action(&view, Action {ActionType::MoveCursorLeft}); + parse_action(&view, Action {ActionType::MoveCursorLeft}); } else if (k.value() == rawterm::Key('B', rawterm::Mod::Arrow)) { auto redraw = @@ -136,7 +136,7 @@ void Controller::start_action_engine() { } } else if (k.value() == rawterm::Key('C', rawterm::Mod::Arrow)) { - parse_action(&view, Action {ActionType::MoveCursorRight}); + parse_action(&view, Action {ActionType::MoveCursorRight}); } else if (k.value() == rawterm::Key(' ', rawterm::Mod::Backspace)) { auto draw = parse_action(&view, Action {ActionType::Backspace}); @@ -171,7 +171,7 @@ void Controller::start_action_engine() { if (k.value() == rawterm::Key('a')) { if (is_readonly_model()) { continue; } - parse_action(&view, Action {ActionType::MoveCursorRight}); + parse_action(&view, Action {ActionType::MoveCursorRight}); parse_action(&view, Action {ActionType::ChangeMode, Mode::Write}); // Move cur to end of line and enter insert mode @@ -296,7 +296,7 @@ void Controller::start_action_engine() { uint32_t horizontal_cursor_pos = view.get_active_model()->current_char; while (horizontal_cursor_pos) { - parse_action(&view, Action {ActionType::MoveCursorLeft}); + parse_action(&view, Action {ActionType::MoveCursorLeft}); horizontal_cursor_pos--; } diff --git a/tests/integration/command_mode_test.py b/tests/integration/command_mode_test.py index 455dbc7..1e40fdf 100644 --- a/tests/integration/command_mode_test.py +++ b/tests/integration/command_mode_test.py @@ -78,6 +78,7 @@ def test_quit_all_this_modified_file(r: TmuxRunner): current_cursor: tuple[int, ...] = r.cursor_pos() r.iris_cmd("qa") + time.sleep(0.1) assert r.await_statusbar_parts()[-2] != "[2]" assert r.await_statusbar_parts()[1] == "[X]" assert " | " not in r.lines()[0] # no tab bar @@ -201,6 +202,7 @@ def test_write_all_command(r: TmuxRunner): r.iris_cmd("wa") assert "[X]" not in r.statusbar_parts() assert "*" not in r.await_tab_bar_parts()[1] + time.sleep(0.1) with open(r.filename, "r") as f: first_line: str = f.readlines()[0] diff --git a/tests/integration/normal_mode_test.py b/tests/integration/normal_mode_test.py index bffc955..4001ad9 100644 --- a/tests/integration/normal_mode_test.py +++ b/tests/integration/normal_mode_test.py @@ -20,7 +20,7 @@ def test_a_key(r: TmuxRunner): statusbar: list[str] = r.await_statusbar_parts() assert statusbar[0] == "WRITE" - assert statusbar[-1] == "1:1" + assert statusbar[-1] == "1:2" @setup("tests/fixture/test_file_1.txt") diff --git a/tests/integration/ui_test.py b/tests/integration/ui_test.py index b3a7ce5..3624930 100644 --- a/tests/integration/ui_test.py +++ b/tests/integration/ui_test.py @@ -202,6 +202,7 @@ def test_multi_file_cursor_on_active_line(r: TmuxRunner): @setup("tests/fixture/test_file_1.txt", multi_file=True) def test_modified_marker_in_tab_bar(r: TmuxRunner): r.press("x") + time.sleep(0.1) tab_bar = r.await_tab_bar_parts() assert tab_bar[0] == "temp_file.txt" r.assert_inverted_text(tab_bar[1], "test_file_1.txt*")