Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void Controller::start_action_engine() {
continue;

} else if (k.value() == rawterm::Key('D', rawterm::Mod::Arrow)) {
parse_action<void, None>(&view, Action<void> {ActionType::MoveCursorLeft});
parse_action<void, bool>(&view, Action<void> {ActionType::MoveCursorLeft});

} else if (k.value() == rawterm::Key('B', rawterm::Mod::Arrow)) {
auto redraw =
Expand All @@ -136,7 +136,7 @@ void Controller::start_action_engine() {
}

} else if (k.value() == rawterm::Key('C', rawterm::Mod::Arrow)) {
parse_action<void, None>(&view, Action<void> {ActionType::MoveCursorRight});
parse_action<void, bool>(&view, Action<void> {ActionType::MoveCursorRight});

} else if (k.value() == rawterm::Key(' ', rawterm::Mod::Backspace)) {
auto draw = parse_action<void, Redraw>(&view, Action<void> {ActionType::Backspace});
Expand Down Expand Up @@ -171,7 +171,7 @@ void Controller::start_action_engine() {
if (k.value() == rawterm::Key('a')) {
if (is_readonly_model()) { continue; }

parse_action<void, None>(&view, Action<void> {ActionType::MoveCursorRight});
parse_action<void, bool>(&view, Action<void> {ActionType::MoveCursorRight});
parse_action<Mode, None>(&view, Action<Mode> {ActionType::ChangeMode, Mode::Write});

// Move cur to end of line and enter insert mode
Expand Down Expand Up @@ -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<void, None>(&view, Action<void> {ActionType::MoveCursorLeft});
parse_action<void, bool>(&view, Action<void> {ActionType::MoveCursorLeft});
horizontal_cursor_pos--;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/integration/command_mode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/normal_mode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions tests/integration/ui_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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*")
Expand Down
Loading