diff --git a/default-plugins/status-bar/src/tip/data.rs b/default-plugins/status-bar/src/tip/data.rs index c0ea2242d6..33921f08a6 100644 --- a/default-plugins/status-bar/src/tip/data.rs +++ b/default-plugins/status-bar/src/tip/data.rs @@ -47,7 +47,7 @@ fn quicknav_full(palette: Palette) -> LinePart { Style::new().paint(" => open new pane. "), Style::new().fg(orange_color).bold().paint("Alt"), Style::new().paint(" + "), - Style::new().fg(green_color).bold().paint("<[]"), + Style::new().fg(green_color).bold().paint("<←↓↑→"), Style::new().paint(" or "), Style::new().fg(green_color).bold().paint("hjkl>"), Style::new().paint(" => navigate between panes. "), @@ -70,7 +70,7 @@ fn quicknav_medium(palette: Palette) -> LinePart { Style::new().paint(" => new pane. "), Style::new().fg(orange_color).bold().paint("Alt"), Style::new().paint(" + "), - Style::new().fg(green_color).bold().paint("<[]"), + Style::new().fg(green_color).bold().paint("<←↓↑→"), Style::new().paint(" or "), Style::new().fg(green_color).bold().paint("hjkl>"), Style::new().paint(" => navigate. "), @@ -91,7 +91,7 @@ fn quicknav_short(palette: Palette) -> LinePart { Style::new().paint(" + "), Style::new().fg(green_color).bold().paint("n"), Style::new().paint("/"), - Style::new().fg(green_color).bold().paint("[]"), + Style::new().fg(green_color).bold().paint("<←↓↑→"), Style::new().paint("/"), Style::new().fg(green_color).bold().paint("hjkl"), Style::new().paint("/"), diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__bracketed_paste.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__bracketed_paste.snap index 2063f007f4..93bdc8b656 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__bracketed_paste.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__bracketed_paste.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1673 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_pane.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_pane.snap index e583c90b01..628861b850 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_pane.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_pane.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 558 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_tab.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_tab.snap index f6dd6b8205..257be3a4f4 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_tab.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_tab.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 498 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap index 59576e22c1..f7d0dce7c9 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 967 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_pane_with_mouse.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_pane_with_mouse.snap index f6dd6b8205..350dcb072a 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_pane_with_mouse.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_pane_with_mouse.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1061 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_tab_with_layout.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_tab_with_layout.snap index fc4ff6d43e..5c7f369be4 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_tab_with_layout.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_tab_with_layout.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1757 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  Tab #2  Tab #3  Tab #4  Tab #5  Tab #6  Tab #7  Tab #8  Tab #9  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__mirrored_sessions.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__mirrored_sessions.snap index bfb3fcd9dd..7f10a19f32 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__mirrored_sessions.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__mirrored_sessions.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1344 expression: first_runner_snapshot - --- Zellij (mirrored_sessions)  Tab #1  Tab #2  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: first_runner_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab-2.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab-2.snap index 5868eb441d..49738bcf0b 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab-2.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab-2.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1523 expression: second_runner_snapshot - --- Zellij (multiple_users_in_same_pane_and_tab)  Tab #1 [ ] ┌ Pane #1 ───────────┤ FOCUSED USER: ├───────────────────┐┌ Pane #2 ──────────────┤ MY FOCUS ├───────────────────────┐ @@ -26,4 +26,4 @@ expression: second_runner_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab.snap index e9355a4496..1120822ade 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1522 expression: first_runner_snapshot - --- Zellij (multiple_users_in_same_pane_and_tab)  Tab #1 [ ] ┌ Pane #1 ──────────────┤ MY FOCUS ├───────────────────────┐┌ Pane #2 ───────────┤ FOCUSED USER: ├───────────────────┐ @@ -26,4 +26,4 @@ expression: first_runner_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs-2.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs-2.snap index 7b983dfdd3..99ce3e3758 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs-2.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs-2.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1618 expression: second_runner_snapshot - --- Zellij (multiple_users_in_different_tabs)  Tab #1 [ ] Tab #2  ┌ Pane #1 ────────────────────────────────────────────┤ MY FOCUS ├─────────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: second_runner_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs.snap index 4a1926d636..e8a89858b3 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1617 expression: first_runner_snapshot - --- Zellij (multiple_users_in_different_tabs)  Tab #1  Tab #2 [ ] ┌ Pane #1 ────────────────────────────────────────────┤ MY FOCUS ├─────────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: first_runner_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab-2.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab-2.snap index 92d189c42b..abc72d7cb2 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab-2.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab-2.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1433 expression: second_runner_snapshot - --- Zellij (multiple_users_in_same_pane_and_tab)  Tab #1 [ ] ┌ Pane #1 ─────────────────────────────────────────┤ MY FOCUS AND: ├─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: second_runner_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab.snap index 9944ee812e..874d94c8ba 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1432 expression: first_runner_snapshot - --- Zellij (multiple_users_in_same_pane_and_tab)  Tab #1 [ ] ┌ Pane #1 ─────────────────────────────────────────┤ MY FOCUS AND: ├─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: first_runner_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__open_new_tab.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__open_new_tab.snap index b9ae7ea004..d973b99497 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__open_new_tab.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__open_new_tab.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 418 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  Tab #2  ┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_pane.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_pane.snap index 8a98304229..5e6a3bf756 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_pane.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_pane.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 764 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ───────────────────────────────────────────┐┌ Pane #2 ───────────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └────────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_terminal_window.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_terminal_window.snap index eb82047f9a..513b0ec67c 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_terminal_window.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_terminal_window.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 883 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ───────────────────────────────────────┐┌ Pane #2 ───────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └────────────────────────────────────────────────┘└────────────────────────────────────────────────┘ Ctrl + g  p  t  n  h  s  o  q  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__scrolling_inside_a_pane_with_mouse.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__scrolling_inside_a_pane_with_mouse.snap index e7e2fa4207..b027448680 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__scrolling_inside_a_pane_with_mouse.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__scrolling_inside_a_pane_with_mouse.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1154 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────── SCROLL: 1/1 ┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││line19 00000000000000000000000000000000000000000000000000█│ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__split_terminals_vertically.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__split_terminals_vertically.snap index a9510a1969..75aede2856 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__split_terminals_vertically.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__split_terminals_vertically.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 151 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__start_without_pane_frames.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__start_without_pane_frames.snap index 8cf50995ee..29882af46d 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__start_without_pane_frames.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__start_without_pane_frames.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1200 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  $ │$ █ @@ -26,4 +26,4 @@ $ │$ █ │ │ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__starts_with_one_terminal.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__starts_with_one_terminal.snap index e583c90b01..31e254c2d1 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__starts_with_one_terminal.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__starts_with_one_terminal.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 104 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__tmux_mode.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__tmux_mode.snap index a9510a1969..4071f2030a 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__tmux_mode.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__tmux_mode.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 1804 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__typing_exit_closes_pane.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__typing_exit_closes_pane.snap index e583c90b01..4b37eb7d63 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__typing_exit_closes_pane.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__typing_exit_closes_pane.snap @@ -1,7 +1,7 @@ --- source: src/tests/e2e/cases.rs +assertion_line: 702 expression: last_snapshot - --- Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -26,4 +26,4 @@ expression: last_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SCROLL  SESSION  QUIT  - Tip: Alt + => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane. + Tip: Alt + => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane. diff --git a/zellij-tile/src/data.rs b/zellij-tile/src/data.rs index 24ffb8cf63..c50ef47902 100644 --- a/zellij-tile/src/data.rs +++ b/zellij-tile/src/data.rs @@ -46,14 +46,29 @@ pub enum Key { Insert, F(u8), Char(char), - Alt(char), + Alt(CharOrArrow), Ctrl(char), Null, Esc, } #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CharOrArrow { + Char(char), + Direction(Direction), +} +/// The four directions (left, right, up, down). +#[derive(Eq, Clone, Copy, Debug, PartialEq, Hash, Deserialize, Serialize)] +pub enum Direction { + Left, + Right, + Up, + Down, +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] // FIXME: This should be extended to handle different button clicks (not just // left click) and the `ScrollUp` and `ScrollDown` events could probably be // merged into a single `Scroll(isize)` event. diff --git a/zellij-utils/assets/config/default.yaml b/zellij-utils/assets/config/default.yaml index 1e435fffab..dbf9e967a9 100644 --- a/zellij-utils/assets/config/default.yaml +++ b/zellij-utils/assets/config/default.yaml @@ -29,17 +29,13 @@ keybinds: - action: [NewPane: ] key: [ Alt: 'n',] - action: [MoveFocusOrTab: Left,] - key: [ Alt: 'h',] + key: [ Alt: 'h', Alt: Left] - action: [MoveFocusOrTab: Right,] - key: [ Alt: 'l',] + key: [ Alt: 'l', Alt: Right ] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up, ] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -84,18 +80,14 @@ keybinds: key: [Char: '-'] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -149,18 +141,14 @@ keybinds: key: [Char: 'e'] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] # The Alt: Left etc. variants are temporary hacks and will be removed in the future - please do not rely on them! + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -198,18 +186,14 @@ keybinds: key: [Char: 'l', Right,] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] # The Alt: Left etc. variants are temporary hacks and will be removed in the future - please do not rely on them! + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -269,18 +253,14 @@ keybinds: key: [ Char: "\t" ] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] # The Alt: Left etc. variants are temporary hacks and will be removed in the future - please do not rely on them! + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -322,18 +302,14 @@ keybinds: key: [Char: 'u',] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] # The Alt: Left etc. variants are temporary hacks and will be removed in the future - please do not rely on them! + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -347,18 +323,14 @@ keybinds: key: [Esc,] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -372,18 +344,14 @@ keybinds: key: [Esc,] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -413,18 +381,14 @@ keybinds: key: [Char: 'd',] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [Resize: Increase,] key: [ Alt: '='] - action: [Resize: Increase,] @@ -484,18 +448,14 @@ keybinds: key: [ Char: 'k'] - action: [NewPane: ,] key: [ Alt: 'n',] - - action: [MoveFocus: Left,] - key: [ Alt: 'h',] - - action: [MoveFocus: Right,] - key: [ Alt: 'l',] + - action: [MoveFocusOrTab: Left,] + key: [ Alt: 'h', Alt: Left] + - action: [MoveFocusOrTab: Right,] + key: [ Alt: 'l', Alt: Right] - action: [MoveFocus: Down,] - key: [ Alt: 'j',] + key: [ Alt: 'j', Alt: Down] - action: [MoveFocus: Up,] - key: [ Alt: 'k',] - - action: [FocusPreviousPane,] - key: [ Alt: '[',] - - action: [FocusNextPane,] - key: [ Alt: ']',] + key: [ Alt: 'k', Alt: Up] - action: [FocusNextPane,] key: [ Char: 'o'] - action: [Resize: Increase,] diff --git a/zellij-utils/src/input/mod.rs b/zellij-utils/src/input/mod.rs index 869c513a0a..2fb7deaf76 100644 --- a/zellij-utils/src/input/mod.rs +++ b/zellij-utils/src/input/mod.rs @@ -14,7 +14,7 @@ use crate::envs; use termwiz::input::{InputEvent, InputParser, KeyCode, KeyEvent, Modifiers}; use zellij_tile::{ data::{InputMode, Key, ModeInfo, PluginCapabilities}, - prelude::Style, + prelude::{CharOrArrow, Direction, Style}, }; /// Creates a [`ModeInfo`] struct indicating the current [`InputMode`] and its keybinds @@ -110,20 +110,41 @@ pub fn cast_termwiz_key(event: KeyEvent, raw_bytes: &[u8]) -> Key { if modifiers.contains(Modifiers::CTRL) { Key::Ctrl(c.to_lowercase().next().unwrap_or_default()) } else if modifiers.contains(Modifiers::ALT) { - Key::Alt(c.to_lowercase().next().unwrap_or_default()) + Key::Alt(CharOrArrow::Char(c)) } else { Key::Char(c) } } KeyCode::Backspace => Key::Backspace, - KeyCode::LeftArrow => Key::Left, - KeyCode::ApplicationLeftArrow => Key::Left, - KeyCode::RightArrow => Key::Right, - KeyCode::ApplicationRightArrow => Key::Right, - KeyCode::UpArrow => Key::Up, - KeyCode::ApplicationUpArrow => Key::Up, - KeyCode::DownArrow => Key::Down, - KeyCode::ApplicationDownArrow => Key::Down, + KeyCode::LeftArrow | KeyCode::ApplicationLeftArrow => { + if modifiers.contains(Modifiers::ALT) { + Key::Alt(CharOrArrow::Direction(Direction::Left)) + } else { + Key::Left + } + } + KeyCode::RightArrow | KeyCode::ApplicationRightArrow => { + if modifiers.contains(Modifiers::ALT) { + Key::Alt(CharOrArrow::Direction(Direction::Right)) + } else { + Key::Right + } + } + KeyCode::UpArrow | KeyCode::ApplicationUpArrow => { + if modifiers.contains(Modifiers::ALT) { + //Key::AltPlusUpArrow + Key::Alt(CharOrArrow::Direction(Direction::Up)) + } else { + Key::Up + } + } + KeyCode::DownArrow | KeyCode::ApplicationDownArrow => { + if modifiers.contains(Modifiers::ALT) { + Key::Alt(CharOrArrow::Direction(Direction::Down)) + } else { + Key::Down + } + } KeyCode::Home => Key::Home, KeyCode::End => Key::End, KeyCode::PageUp => Key::PageUp, diff --git a/zellij-utils/src/input/unit/keybinds_test.rs b/zellij-utils/src/input/unit/keybinds_test.rs index 2cf84b7035..387675c524 100644 --- a/zellij-utils/src/input/unit/keybinds_test.rs +++ b/zellij-utils/src/input/unit/keybinds_test.rs @@ -233,7 +233,7 @@ fn unbind_multiple_modes() { #[test] fn unbind_single_keybind_single_mode() { - let unbind = Unbind::Keys(vec![Key::Alt('n')]); + let unbind = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]); let unbind_from_yaml = UnbindFromYaml { unbind }; let key_action_unbinds = vec![KeyActionUnbind::Unbind(unbind_from_yaml)]; @@ -250,14 +250,14 @@ fn unbind_single_keybind_single_mode() { let result = mode_keybinds .expect("Mode shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); assert!(result.is_none()); } #[test] fn unbind_single_keybind_multiple_modes() { - let unbind_n = Unbind::Keys(vec![Key::Alt('n')]); - let unbind_h = Unbind::Keys(vec![Key::Alt('h')]); + let unbind_n = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]); + let unbind_h = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('h'))]); let unbind_from_yaml_n = UnbindFromYaml { unbind: unbind_n }; let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h }; let key_action_unbinds_n = vec![KeyActionUnbind::Unbind(unbind_from_yaml_n)]; @@ -278,15 +278,18 @@ fn unbind_single_keybind_multiple_modes() { let result_normal = normal .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); - let result_pane = pane.expect("Mode shouldn't be empty").0.get(&Key::Alt('h')); + .get(&Key::Alt(CharOrArrow::Char('n'))); + let result_pane = pane + .expect("Mode shouldn't be empty") + .0 + .get(&Key::Alt(CharOrArrow::Char('h'))); assert!(result_normal.is_none()); assert!(result_pane.is_none()); } #[test] fn unbind_multiple_keybinds_single_mode() { - let unbind = Unbind::Keys(vec![Key::Alt('n'), Key::Ctrl('p')]); + let unbind = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n')), Key::Ctrl('p')]); let unbind_from_yaml = UnbindFromYaml { unbind }; let key_action_unbinds = vec![KeyActionUnbind::Unbind(unbind_from_yaml)]; @@ -303,7 +306,7 @@ fn unbind_multiple_keybinds_single_mode() { let result_n = mode_keybinds .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_p = mode_keybinds .expect("ModeKeybinds shouldn't be empty") .0 @@ -314,7 +317,7 @@ fn unbind_multiple_keybinds_single_mode() { #[test] fn unbind_multiple_keybinds_multiple_modes() { - let unbind_normal = Unbind::Keys(vec![Key::Alt('n'), Key::Ctrl('p')]); + let unbind_normal = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n')), Key::Ctrl('p')]); let unbind_resize = Unbind::Keys(vec![Key::Char('h'), Key::Ctrl('r')]); let unbind_from_yaml_normal = UnbindFromYaml { unbind: unbind_normal, @@ -340,7 +343,7 @@ fn unbind_multiple_keybinds_multiple_modes() { let result_normal_1 = mode_keybinds_normal .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_normal_2 = mode_keybinds_normal .expect("ModeKeybinds shouldn't be empty") .0 @@ -361,7 +364,10 @@ fn unbind_multiple_keybinds_multiple_modes() { #[test] fn unbind_multiple_keybinds_all_modes() { - let unbind = Unbind::Keys(vec![Key::Alt('n'), Key::Alt('h')]); + let unbind = Unbind::Keys(vec![ + Key::Alt(CharOrArrow::Char('n')), + Key::Alt(CharOrArrow::Char('h')), + ]); let keys = HashMap::>::new(); let keybinds_from_yaml = KeybindsFromYaml { keybinds: keys, @@ -374,7 +380,7 @@ fn unbind_multiple_keybinds_all_modes() { let result_normal_1 = mode_keybinds_normal .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_normal_2 = mode_keybinds_normal .expect("ModeKeybinds shouldn't be empty") .0 @@ -395,7 +401,7 @@ fn unbind_multiple_keybinds_all_modes() { #[test] fn unbind_all_toplevel_single_key_single_mode() { - let unbind = Unbind::Keys(vec![Key::Alt('h')]); + let unbind = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('h'))]); let unbind_from_yaml = UnbindFromYaml { unbind }; let key_action_unbinds_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml)]; let mut keys = HashMap::>::new(); @@ -411,8 +417,8 @@ fn unbind_all_toplevel_single_key_single_mode() { #[test] fn unbind_all_toplevel_single_key_multiple_modes() { - let unbind_n = Unbind::Keys(vec![Key::Alt('n')]); - let unbind_h = Unbind::Keys(vec![Key::Alt('h')]); + let unbind_n = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]); + let unbind_h = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('h'))]); let unbind_from_yaml_n = UnbindFromYaml { unbind: unbind_n }; let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h }; let key_action_unbinds_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml_n)]; @@ -431,8 +437,8 @@ fn unbind_all_toplevel_single_key_multiple_modes() { #[test] fn unbind_all_toplevel_multiple_key_multiple_modes() { - let unbind_n = Unbind::Keys(vec![Key::Alt('n'), Key::Ctrl('p')]); - let unbind_h = Unbind::Keys(vec![Key::Alt('h'), Key::Ctrl('t')]); + let unbind_n = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n')), Key::Ctrl('p')]); + let unbind_h = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('h')), Key::Ctrl('t')]); let unbind_from_yaml_n = UnbindFromYaml { unbind: unbind_n }; let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h }; let key_action_unbinds_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml_n)]; @@ -472,7 +478,7 @@ fn unbind_single_keybind_all_modes() { let keys = HashMap::>::new(); let from_yaml = KeybindsFromYaml { keybinds: keys, - unbind: Unbind::Keys(vec![Key::Alt('n')]), + unbind: Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]), }; let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml)); @@ -482,25 +488,25 @@ fn unbind_single_keybind_all_modes() { .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_pane = keybinds_from_yaml .0 .get(&InputMode::Pane) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_resize = keybinds_from_yaml .0 .get(&InputMode::Resize) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_tab = keybinds_from_yaml .0 .get(&InputMode::Tab) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); assert!(result_normal.is_none()); assert!(result_pane.is_none()); @@ -510,14 +516,14 @@ fn unbind_single_keybind_all_modes() { #[test] fn unbind_single_toplevel_single_key_single_mode_identical() { - let unbind = Unbind::Keys(vec![Key::Alt('n')]); + let unbind = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]); let unbind_from_yaml = UnbindFromYaml { unbind }; let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)]; let mut keys = HashMap::>::new(); keys.insert(InputMode::Normal, key_action_unbind); let from_yaml = KeybindsFromYaml { keybinds: keys, - unbind: Unbind::Keys(vec![Key::Alt('n')]), + unbind: Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]), }; let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml)); @@ -527,25 +533,25 @@ fn unbind_single_toplevel_single_key_single_mode_identical() { .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_pane = keybinds_from_yaml .0 .get(&InputMode::Pane) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_resize = keybinds_from_yaml .0 .get(&InputMode::Resize) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_tab = keybinds_from_yaml .0 .get(&InputMode::Tab) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); assert!(result_normal.is_none()); assert!(result_pane.is_none()); @@ -555,14 +561,14 @@ fn unbind_single_toplevel_single_key_single_mode_identical() { #[test] fn unbind_single_toplevel_single_key_single_mode_differing() { - let unbind = Unbind::Keys(vec![Key::Alt('l')]); + let unbind = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('l'))]); let unbind_from_yaml = UnbindFromYaml { unbind }; let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)]; let mut keys = HashMap::>::new(); keys.insert(InputMode::Normal, key_action_unbind); let from_yaml = KeybindsFromYaml { keybinds: keys, - unbind: Unbind::Keys(vec![Key::Alt('n')]), + unbind: Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]), }; let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml)); @@ -572,25 +578,25 @@ fn unbind_single_toplevel_single_key_single_mode_differing() { .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_normal_l = keybinds_from_yaml .0 .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('l')); + .get(&Key::Alt(CharOrArrow::Char('l'))); let result_resize_n = keybinds_from_yaml .0 .get(&InputMode::Resize) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_resize_l = keybinds_from_yaml .0 .get(&InputMode::Resize) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('l')); + .get(&Key::Alt(CharOrArrow::Char('l'))); assert!(result_normal_n.is_none()); assert!(result_normal_l.is_none()); @@ -600,7 +606,7 @@ fn unbind_single_toplevel_single_key_single_mode_differing() { #[test] fn unbind_single_toplevel_single_key_multiple_modes() { - let unbind = Unbind::Keys(vec![Key::Alt('l')]); + let unbind = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('l'))]); let unbind_from_yaml = UnbindFromYaml { unbind }; let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)]; let mut keys = HashMap::>::new(); @@ -608,7 +614,7 @@ fn unbind_single_toplevel_single_key_multiple_modes() { keys.insert(InputMode::Pane, key_action_unbind); let from_yaml = KeybindsFromYaml { keybinds: keys, - unbind: Unbind::Keys(vec![Key::Alt('n')]), + unbind: Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]), }; let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml)); @@ -618,25 +624,25 @@ fn unbind_single_toplevel_single_key_multiple_modes() { .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_normal_l = keybinds_from_yaml .0 .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('l')); + .get(&Key::Alt(CharOrArrow::Char('l'))); let result_pane_n = keybinds_from_yaml .0 .get(&InputMode::Pane) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_pane_l = keybinds_from_yaml .0 .get(&InputMode::Pane) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('l')); + .get(&Key::Alt(CharOrArrow::Char('l'))); assert!(result_normal_n.is_none()); assert!(result_normal_l.is_none()); @@ -647,10 +653,10 @@ fn unbind_single_toplevel_single_key_multiple_modes() { #[test] fn unbind_single_toplevel_multiple_keys_single_mode() { let unbind = Unbind::Keys(vec![ - Key::Alt('l'), - Key::Alt('h'), - Key::Alt('j'), - Key::Alt('k'), + Key::Alt(CharOrArrow::Char('l')), + Key::Alt(CharOrArrow::Char('h')), + Key::Alt(CharOrArrow::Char('j')), + Key::Alt(CharOrArrow::Char('k')), ]); let unbind_from_yaml = UnbindFromYaml { unbind }; let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)]; @@ -659,7 +665,7 @@ fn unbind_single_toplevel_multiple_keys_single_mode() { keys.insert(InputMode::Pane, key_action_unbind); let from_yaml = KeybindsFromYaml { keybinds: keys, - unbind: Unbind::Keys(vec![Key::Alt('n')]), + unbind: Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]), }; let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml)); @@ -669,25 +675,25 @@ fn unbind_single_toplevel_multiple_keys_single_mode() { .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_normal_l = keybinds_from_yaml .0 .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('l')); + .get(&Key::Alt(CharOrArrow::Char('l'))); let result_normal_k = keybinds_from_yaml .0 .get(&InputMode::Pane) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('k')); + .get(&Key::Alt(CharOrArrow::Char('k'))); let result_normal_h = keybinds_from_yaml .0 .get(&InputMode::Pane) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('h')); + .get(&Key::Alt(CharOrArrow::Char('h'))); assert!(result_normal_n.is_none()); assert!(result_normal_l.is_none()); @@ -697,12 +703,15 @@ fn unbind_single_toplevel_multiple_keys_single_mode() { #[test] fn unbind_single_toplevel_multiple_keys_multiple_modes() { - let unbind_normal = Unbind::Keys(vec![Key::Alt('l'), Key::Ctrl('p')]); + let unbind_normal = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('l')), Key::Ctrl('p')]); let unbind_from_yaml_normal = UnbindFromYaml { unbind: unbind_normal, }; let key_action_unbind_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml_normal)]; - let unbind = Unbind::Keys(vec![Key::Alt('l'), Key::Alt('k')]); + let unbind = Unbind::Keys(vec![ + Key::Alt(CharOrArrow::Char('l')), + Key::Alt(CharOrArrow::Char('k')), + ]); let unbind_from_yaml = UnbindFromYaml { unbind }; let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)]; let mut keys = HashMap::>::new(); @@ -710,7 +719,7 @@ fn unbind_single_toplevel_multiple_keys_multiple_modes() { keys.insert(InputMode::Pane, key_action_unbind); let from_yaml = KeybindsFromYaml { keybinds: keys, - unbind: Unbind::Keys(vec![Key::Alt('n')]), + unbind: Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]), }; let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml)); @@ -720,7 +729,7 @@ fn unbind_single_toplevel_multiple_keys_multiple_modes() { .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_normal_p = keybinds_from_yaml .0 .get(&InputMode::Normal) @@ -732,7 +741,7 @@ fn unbind_single_toplevel_multiple_keys_multiple_modes() { .get(&InputMode::Normal) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('l')); + .get(&Key::Alt(CharOrArrow::Char('l'))); let result_pane_p = keybinds_from_yaml .0 .get(&InputMode::Pane) @@ -744,13 +753,13 @@ fn unbind_single_toplevel_multiple_keys_multiple_modes() { .get(&InputMode::Pane) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('n')); + .get(&Key::Alt(CharOrArrow::Char('n'))); let result_pane_l = keybinds_from_yaml .0 .get(&InputMode::Pane) .expect("ModeKeybinds shouldn't be empty") .0 - .get(&Key::Alt('l')); + .get(&Key::Alt(CharOrArrow::Char('l'))); assert!(result_normal_n.is_none()); assert!(result_normal_l.is_none());