mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-22 22:26:54 +03:00
feat(ui): add navigation with alt + arrow keys (#1264)
* feat(ui): change from non-working alt-brackets to alt-arrows * style(fmt): rustfmt * fix: improve parsing of `alt` combination keys The binding of the keys can now be specified with: - Alt: 'c' - Alt: Up - Alt: Down - Alt: Left - Alt: Right * chore(fmt): rustfmt Co-authored-by: a-kenji <aks.kenji@protonmail.com>
This commit is contained in:
parent
854228046e
commit
18ee784e2d
@ -47,7 +47,7 @@ fn quicknav_full(palette: Palette) -> LinePart {
|
|||||||
Style::new().paint(" => open new pane. "),
|
Style::new().paint(" => open new pane. "),
|
||||||
Style::new().fg(orange_color).bold().paint("Alt"),
|
Style::new().fg(orange_color).bold().paint("Alt"),
|
||||||
Style::new().paint(" + "),
|
Style::new().paint(" + "),
|
||||||
Style::new().fg(green_color).bold().paint("<[]"),
|
Style::new().fg(green_color).bold().paint("<←↓↑→"),
|
||||||
Style::new().paint(" or "),
|
Style::new().paint(" or "),
|
||||||
Style::new().fg(green_color).bold().paint("hjkl>"),
|
Style::new().fg(green_color).bold().paint("hjkl>"),
|
||||||
Style::new().paint(" => navigate between panes. "),
|
Style::new().paint(" => navigate between panes. "),
|
||||||
@ -70,7 +70,7 @@ fn quicknav_medium(palette: Palette) -> LinePart {
|
|||||||
Style::new().paint(" => new pane. "),
|
Style::new().paint(" => new pane. "),
|
||||||
Style::new().fg(orange_color).bold().paint("Alt"),
|
Style::new().fg(orange_color).bold().paint("Alt"),
|
||||||
Style::new().paint(" + "),
|
Style::new().paint(" + "),
|
||||||
Style::new().fg(green_color).bold().paint("<[]"),
|
Style::new().fg(green_color).bold().paint("<←↓↑→"),
|
||||||
Style::new().paint(" or "),
|
Style::new().paint(" or "),
|
||||||
Style::new().fg(green_color).bold().paint("hjkl>"),
|
Style::new().fg(green_color).bold().paint("hjkl>"),
|
||||||
Style::new().paint(" => navigate. "),
|
Style::new().paint(" => navigate. "),
|
||||||
@ -91,7 +91,7 @@ fn quicknav_short(palette: Palette) -> LinePart {
|
|||||||
Style::new().paint(" + "),
|
Style::new().paint(" + "),
|
||||||
Style::new().fg(green_color).bold().paint("n"),
|
Style::new().fg(green_color).bold().paint("n"),
|
||||||
Style::new().paint("/"),
|
Style::new().paint("/"),
|
||||||
Style::new().fg(green_color).bold().paint("[]"),
|
Style::new().fg(green_color).bold().paint("<←↓↑→"),
|
||||||
Style::new().paint("/"),
|
Style::new().paint("/"),
|
||||||
Style::new().fg(green_color).bold().paint("hjkl"),
|
Style::new().fg(green_color).bold().paint("hjkl"),
|
||||||
Style::new().paint("/"),
|
Style::new().paint("/"),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1673
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 558
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 498
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 967
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1061
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1757
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1 Tab #2 Tab #3 Tab #4 Tab #5 Tab #6 Tab #7 Tab #8 Tab #9
|
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 ─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1344
|
||||||
expression: first_runner_snapshot
|
expression: first_runner_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (mirrored_sessions) Tab #1 Tab #2
|
Zellij (mirrored_sessions) Tab #1 Tab #2
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: first_runner_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1523
|
||||||
expression: second_runner_snapshot
|
expression: second_runner_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (multiple_users_in_same_pane_and_tab) Tab #1 [ ]
|
Zellij (multiple_users_in_same_pane_and_tab) Tab #1 [ ]
|
||||||
┌ Pane #1 ───────────┤ FOCUSED USER: ├───────────────────┐┌ Pane #2 ──────────────┤ MY FOCUS ├───────────────────────┐
|
┌ Pane #1 ───────────┤ FOCUSED USER: ├───────────────────┐┌ Pane #2 ──────────────┤ MY FOCUS ├───────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: second_runner_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1522
|
||||||
expression: first_runner_snapshot
|
expression: first_runner_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (multiple_users_in_same_pane_and_tab) Tab #1 [ ]
|
Zellij (multiple_users_in_same_pane_and_tab) Tab #1 [ ]
|
||||||
┌ Pane #1 ──────────────┤ MY FOCUS ├───────────────────────┐┌ Pane #2 ───────────┤ FOCUSED USER: ├───────────────────┐
|
┌ Pane #1 ──────────────┤ MY FOCUS ├───────────────────────┐┌ Pane #2 ───────────┤ FOCUSED USER: ├───────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: first_runner_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1618
|
||||||
expression: second_runner_snapshot
|
expression: second_runner_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (multiple_users_in_different_tabs) Tab #1 [ ] Tab #2
|
Zellij (multiple_users_in_different_tabs) Tab #1 [ ] Tab #2
|
||||||
┌ Pane #1 ────────────────────────────────────────────┤ MY FOCUS ├─────────────────────────────────────────────────────┐
|
┌ Pane #1 ────────────────────────────────────────────┤ MY FOCUS ├─────────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: second_runner_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1617
|
||||||
expression: first_runner_snapshot
|
expression: first_runner_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (multiple_users_in_different_tabs) Tab #1 Tab #2 [ ]
|
Zellij (multiple_users_in_different_tabs) Tab #1 Tab #2 [ ]
|
||||||
┌ Pane #1 ────────────────────────────────────────────┤ MY FOCUS ├─────────────────────────────────────────────────────┐
|
┌ Pane #1 ────────────────────────────────────────────┤ MY FOCUS ├─────────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: first_runner_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1433
|
||||||
expression: second_runner_snapshot
|
expression: second_runner_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (multiple_users_in_same_pane_and_tab) Tab #1 [ ]
|
Zellij (multiple_users_in_same_pane_and_tab) Tab #1 [ ]
|
||||||
┌ Pane #1 ─────────────────────────────────────────┤ MY FOCUS AND: ├─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────┤ MY FOCUS AND: ├─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: second_runner_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1432
|
||||||
expression: first_runner_snapshot
|
expression: first_runner_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (multiple_users_in_same_pane_and_tab) Tab #1 [ ]
|
Zellij (multiple_users_in_same_pane_and_tab) Tab #1 [ ]
|
||||||
┌ Pane #1 ─────────────────────────────────────────┤ MY FOCUS AND: ├─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────┤ MY FOCUS AND: ├─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: first_runner_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 418
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1 Tab #2
|
Zellij (e2e-test) Tab #1 Tab #2
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 764
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ───────────────────────────────────────────┐┌ Pane #2 ───────────────────────────────────────────────────────┐
|
┌ Pane #1 ───────────────────────────────────────────┐┌ Pane #2 ───────────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└────────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 883
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ───────────────────────────────────────┐┌ Pane #2 ───────────────────────────────────────┐
|
┌ Pane #1 ───────────────────────────────────────┐┌ Pane #2 ───────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└────────────────────────────────────────────────┘└────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────┘└────────────────────────────────────────────────┘
|
||||||
Ctrl + g p t n h s o q
|
Ctrl + g p t n h s o q
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1154
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────── SCROLL: 1/1 ┐
|
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────── SCROLL: 1/1 ┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││line19 00000000000000000000000000000000000000000000000000█│
|
│ ││line19 00000000000000000000000000000000000000000000000000█│
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 151
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1200
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
$ │$ █
|
$ │$ █
|
||||||
@ -26,4 +26,4 @@ $ │$ █
|
|||||||
│
|
│
|
||||||
│
|
│
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 104
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 1804
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: src/tests/e2e/cases.rs
|
source: src/tests/e2e/cases.rs
|
||||||
|
assertion_line: 702
|
||||||
expression: last_snapshot
|
expression: last_snapshot
|
||||||
|
|
||||||
---
|
---
|
||||||
Zellij (e2e-test) Tab #1
|
Zellij (e2e-test) Tab #1
|
||||||
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
@ -26,4 +26,4 @@ expression: last_snapshot
|
|||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SCROLL <o> SESSION <q> QUIT
|
||||||
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.
|
Tip: Alt + <n> => new pane. Alt + <←↓↑→ or hjkl> => navigate. Alt + <+-> => resize pane.
|
||||||
|
@ -46,14 +46,29 @@ pub enum Key {
|
|||||||
Insert,
|
Insert,
|
||||||
F(u8),
|
F(u8),
|
||||||
Char(char),
|
Char(char),
|
||||||
Alt(char),
|
Alt(CharOrArrow),
|
||||||
Ctrl(char),
|
Ctrl(char),
|
||||||
Null,
|
Null,
|
||||||
Esc,
|
Esc,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
#[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
|
// FIXME: This should be extended to handle different button clicks (not just
|
||||||
// left click) and the `ScrollUp` and `ScrollDown` events could probably be
|
// left click) and the `ScrollUp` and `ScrollDown` events could probably be
|
||||||
// merged into a single `Scroll(isize)` event.
|
// merged into a single `Scroll(isize)` event.
|
||||||
|
@ -29,17 +29,13 @@ keybinds:
|
|||||||
- action: [NewPane: ]
|
- action: [NewPane: ]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocusOrTab: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
key: [ Alt: 'h', Alt: Left]
|
||||||
- action: [MoveFocusOrTab: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right ]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up, ]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -84,18 +80,14 @@ keybinds:
|
|||||||
key: [Char: '-']
|
key: [Char: '-']
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
key: [ Alt: 'h', Alt: Left]
|
||||||
- action: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -149,18 +141,14 @@ keybinds:
|
|||||||
key: [Char: 'e']
|
key: [Char: 'e']
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
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: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -198,18 +186,14 @@ keybinds:
|
|||||||
key: [Char: 'l', Right,]
|
key: [Char: 'l', Right,]
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
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: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -269,18 +253,14 @@ keybinds:
|
|||||||
key: [ Char: "\t" ]
|
key: [ Char: "\t" ]
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
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: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -322,18 +302,14 @@ keybinds:
|
|||||||
key: [Char: 'u',]
|
key: [Char: 'u',]
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
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: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -347,18 +323,14 @@ keybinds:
|
|||||||
key: [Esc,]
|
key: [Esc,]
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
key: [ Alt: 'h', Alt: Left]
|
||||||
- action: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -372,18 +344,14 @@ keybinds:
|
|||||||
key: [Esc,]
|
key: [Esc,]
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
key: [ Alt: 'h', Alt: Left]
|
||||||
- action: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -413,18 +381,14 @@ keybinds:
|
|||||||
key: [Char: 'd',]
|
key: [Char: 'd',]
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
key: [ Alt: 'h', Alt: Left]
|
||||||
- action: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
key: [ Alt: '=']
|
key: [ Alt: '=']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
@ -484,18 +448,14 @@ keybinds:
|
|||||||
key: [ Char: 'k']
|
key: [ Char: 'k']
|
||||||
- action: [NewPane: ,]
|
- action: [NewPane: ,]
|
||||||
key: [ Alt: 'n',]
|
key: [ Alt: 'n',]
|
||||||
- action: [MoveFocus: Left,]
|
- action: [MoveFocusOrTab: Left,]
|
||||||
key: [ Alt: 'h',]
|
key: [ Alt: 'h', Alt: Left]
|
||||||
- action: [MoveFocus: Right,]
|
- action: [MoveFocusOrTab: Right,]
|
||||||
key: [ Alt: 'l',]
|
key: [ Alt: 'l', Alt: Right]
|
||||||
- action: [MoveFocus: Down,]
|
- action: [MoveFocus: Down,]
|
||||||
key: [ Alt: 'j',]
|
key: [ Alt: 'j', Alt: Down]
|
||||||
- action: [MoveFocus: Up,]
|
- action: [MoveFocus: Up,]
|
||||||
key: [ Alt: 'k',]
|
key: [ Alt: 'k', Alt: Up]
|
||||||
- action: [FocusPreviousPane,]
|
|
||||||
key: [ Alt: '[',]
|
|
||||||
- action: [FocusNextPane,]
|
|
||||||
key: [ Alt: ']',]
|
|
||||||
- action: [FocusNextPane,]
|
- action: [FocusNextPane,]
|
||||||
key: [ Char: 'o']
|
key: [ Char: 'o']
|
||||||
- action: [Resize: Increase,]
|
- action: [Resize: Increase,]
|
||||||
|
@ -14,7 +14,7 @@ use crate::envs;
|
|||||||
use termwiz::input::{InputEvent, InputParser, KeyCode, KeyEvent, Modifiers};
|
use termwiz::input::{InputEvent, InputParser, KeyCode, KeyEvent, Modifiers};
|
||||||
use zellij_tile::{
|
use zellij_tile::{
|
||||||
data::{InputMode, Key, ModeInfo, PluginCapabilities},
|
data::{InputMode, Key, ModeInfo, PluginCapabilities},
|
||||||
prelude::Style,
|
prelude::{CharOrArrow, Direction, Style},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Creates a [`ModeInfo`] struct indicating the current [`InputMode`] and its keybinds
|
/// 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) {
|
if modifiers.contains(Modifiers::CTRL) {
|
||||||
Key::Ctrl(c.to_lowercase().next().unwrap_or_default())
|
Key::Ctrl(c.to_lowercase().next().unwrap_or_default())
|
||||||
} else if modifiers.contains(Modifiers::ALT) {
|
} else if modifiers.contains(Modifiers::ALT) {
|
||||||
Key::Alt(c.to_lowercase().next().unwrap_or_default())
|
Key::Alt(CharOrArrow::Char(c))
|
||||||
} else {
|
} else {
|
||||||
Key::Char(c)
|
Key::Char(c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
KeyCode::Backspace => Key::Backspace,
|
KeyCode::Backspace => Key::Backspace,
|
||||||
KeyCode::LeftArrow => Key::Left,
|
KeyCode::LeftArrow | KeyCode::ApplicationLeftArrow => {
|
||||||
KeyCode::ApplicationLeftArrow => Key::Left,
|
if modifiers.contains(Modifiers::ALT) {
|
||||||
KeyCode::RightArrow => Key::Right,
|
Key::Alt(CharOrArrow::Direction(Direction::Left))
|
||||||
KeyCode::ApplicationRightArrow => Key::Right,
|
} else {
|
||||||
KeyCode::UpArrow => Key::Up,
|
Key::Left
|
||||||
KeyCode::ApplicationUpArrow => Key::Up,
|
}
|
||||||
KeyCode::DownArrow => Key::Down,
|
}
|
||||||
KeyCode::ApplicationDownArrow => Key::Down,
|
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::Home => Key::Home,
|
||||||
KeyCode::End => Key::End,
|
KeyCode::End => Key::End,
|
||||||
KeyCode::PageUp => Key::PageUp,
|
KeyCode::PageUp => Key::PageUp,
|
||||||
|
@ -233,7 +233,7 @@ fn unbind_multiple_modes() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_single_keybind_single_mode() {
|
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 unbind_from_yaml = UnbindFromYaml { unbind };
|
||||||
let key_action_unbinds = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
let key_action_unbinds = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
||||||
|
|
||||||
@ -250,14 +250,14 @@ fn unbind_single_keybind_single_mode() {
|
|||||||
let result = mode_keybinds
|
let result = mode_keybinds
|
||||||
.expect("Mode shouldn't be empty")
|
.expect("Mode shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
assert!(result.is_none());
|
assert!(result.is_none());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_single_keybind_multiple_modes() {
|
fn unbind_single_keybind_multiple_modes() {
|
||||||
let unbind_n = Unbind::Keys(vec![Key::Alt('n')]);
|
let unbind_n = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]);
|
||||||
let unbind_h = Unbind::Keys(vec![Key::Alt('h')]);
|
let unbind_h = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('h'))]);
|
||||||
let unbind_from_yaml_n = UnbindFromYaml { unbind: unbind_n };
|
let unbind_from_yaml_n = UnbindFromYaml { unbind: unbind_n };
|
||||||
let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h };
|
let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h };
|
||||||
let key_action_unbinds_n = vec![KeyActionUnbind::Unbind(unbind_from_yaml_n)];
|
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
|
let result_normal = normal
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_pane = pane.expect("Mode shouldn't be empty").0.get(&Key::Alt('h'));
|
let result_pane = pane
|
||||||
|
.expect("Mode shouldn't be empty")
|
||||||
|
.0
|
||||||
|
.get(&Key::Alt(CharOrArrow::Char('h')));
|
||||||
assert!(result_normal.is_none());
|
assert!(result_normal.is_none());
|
||||||
assert!(result_pane.is_none());
|
assert!(result_pane.is_none());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_multiple_keybinds_single_mode() {
|
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 unbind_from_yaml = UnbindFromYaml { unbind };
|
||||||
let key_action_unbinds = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
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
|
let result_n = mode_keybinds
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_p = mode_keybinds
|
let result_p = mode_keybinds
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
@ -314,7 +317,7 @@ fn unbind_multiple_keybinds_single_mode() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_multiple_keybinds_multiple_modes() {
|
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_resize = Unbind::Keys(vec![Key::Char('h'), Key::Ctrl('r')]);
|
||||||
let unbind_from_yaml_normal = UnbindFromYaml {
|
let unbind_from_yaml_normal = UnbindFromYaml {
|
||||||
unbind: unbind_normal,
|
unbind: unbind_normal,
|
||||||
@ -340,7 +343,7 @@ fn unbind_multiple_keybinds_multiple_modes() {
|
|||||||
let result_normal_1 = mode_keybinds_normal
|
let result_normal_1 = mode_keybinds_normal
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_normal_2 = mode_keybinds_normal
|
let result_normal_2 = mode_keybinds_normal
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
@ -361,7 +364,10 @@ fn unbind_multiple_keybinds_multiple_modes() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_multiple_keybinds_all_modes() {
|
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::<InputMode, Vec<KeyActionUnbind>>::new();
|
let keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
||||||
let keybinds_from_yaml = KeybindsFromYaml {
|
let keybinds_from_yaml = KeybindsFromYaml {
|
||||||
keybinds: keys,
|
keybinds: keys,
|
||||||
@ -374,7 +380,7 @@ fn unbind_multiple_keybinds_all_modes() {
|
|||||||
let result_normal_1 = mode_keybinds_normal
|
let result_normal_1 = mode_keybinds_normal
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_normal_2 = mode_keybinds_normal
|
let result_normal_2 = mode_keybinds_normal
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
@ -395,7 +401,7 @@ fn unbind_multiple_keybinds_all_modes() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_all_toplevel_single_key_single_mode() {
|
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 unbind_from_yaml = UnbindFromYaml { unbind };
|
||||||
let key_action_unbinds_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
let key_action_unbinds_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
||||||
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
||||||
@ -411,8 +417,8 @@ fn unbind_all_toplevel_single_key_single_mode() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_all_toplevel_single_key_multiple_modes() {
|
fn unbind_all_toplevel_single_key_multiple_modes() {
|
||||||
let unbind_n = Unbind::Keys(vec![Key::Alt('n')]);
|
let unbind_n = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]);
|
||||||
let unbind_h = Unbind::Keys(vec![Key::Alt('h')]);
|
let unbind_h = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('h'))]);
|
||||||
let unbind_from_yaml_n = UnbindFromYaml { unbind: unbind_n };
|
let unbind_from_yaml_n = UnbindFromYaml { unbind: unbind_n };
|
||||||
let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h };
|
let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h };
|
||||||
let key_action_unbinds_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml_n)];
|
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]
|
#[test]
|
||||||
fn unbind_all_toplevel_multiple_key_multiple_modes() {
|
fn unbind_all_toplevel_multiple_key_multiple_modes() {
|
||||||
let unbind_n = Unbind::Keys(vec![Key::Alt('n'), Key::Ctrl('p')]);
|
let unbind_n = Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n')), Key::Ctrl('p')]);
|
||||||
let unbind_h = Unbind::Keys(vec![Key::Alt('h'), Key::Ctrl('t')]);
|
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_n = UnbindFromYaml { unbind: unbind_n };
|
||||||
let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h };
|
let unbind_from_yaml_h = UnbindFromYaml { unbind: unbind_h };
|
||||||
let key_action_unbinds_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml_n)];
|
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::<InputMode, Vec<KeyActionUnbind>>::new();
|
let keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
||||||
let from_yaml = KeybindsFromYaml {
|
let from_yaml = KeybindsFromYaml {
|
||||||
keybinds: keys,
|
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));
|
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)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_pane = keybinds_from_yaml
|
let result_pane = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_resize = keybinds_from_yaml
|
let result_resize = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Resize)
|
.get(&InputMode::Resize)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_tab = keybinds_from_yaml
|
let result_tab = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Tab)
|
.get(&InputMode::Tab)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
|
|
||||||
assert!(result_normal.is_none());
|
assert!(result_normal.is_none());
|
||||||
assert!(result_pane.is_none());
|
assert!(result_pane.is_none());
|
||||||
@ -510,14 +516,14 @@ fn unbind_single_keybind_all_modes() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_single_toplevel_single_key_single_mode_identical() {
|
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 unbind_from_yaml = UnbindFromYaml { unbind };
|
||||||
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
||||||
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
||||||
keys.insert(InputMode::Normal, key_action_unbind);
|
keys.insert(InputMode::Normal, key_action_unbind);
|
||||||
let from_yaml = KeybindsFromYaml {
|
let from_yaml = KeybindsFromYaml {
|
||||||
keybinds: keys,
|
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));
|
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)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_pane = keybinds_from_yaml
|
let result_pane = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_resize = keybinds_from_yaml
|
let result_resize = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Resize)
|
.get(&InputMode::Resize)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_tab = keybinds_from_yaml
|
let result_tab = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Tab)
|
.get(&InputMode::Tab)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
|
|
||||||
assert!(result_normal.is_none());
|
assert!(result_normal.is_none());
|
||||||
assert!(result_pane.is_none());
|
assert!(result_pane.is_none());
|
||||||
@ -555,14 +561,14 @@ fn unbind_single_toplevel_single_key_single_mode_identical() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_single_toplevel_single_key_single_mode_differing() {
|
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 unbind_from_yaml = UnbindFromYaml { unbind };
|
||||||
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
||||||
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
||||||
keys.insert(InputMode::Normal, key_action_unbind);
|
keys.insert(InputMode::Normal, key_action_unbind);
|
||||||
let from_yaml = KeybindsFromYaml {
|
let from_yaml = KeybindsFromYaml {
|
||||||
keybinds: keys,
|
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));
|
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)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_normal_l = keybinds_from_yaml
|
let result_normal_l = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Normal)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('l'));
|
.get(&Key::Alt(CharOrArrow::Char('l')));
|
||||||
let result_resize_n = keybinds_from_yaml
|
let result_resize_n = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Resize)
|
.get(&InputMode::Resize)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_resize_l = keybinds_from_yaml
|
let result_resize_l = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Resize)
|
.get(&InputMode::Resize)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('l'));
|
.get(&Key::Alt(CharOrArrow::Char('l')));
|
||||||
|
|
||||||
assert!(result_normal_n.is_none());
|
assert!(result_normal_n.is_none());
|
||||||
assert!(result_normal_l.is_none());
|
assert!(result_normal_l.is_none());
|
||||||
@ -600,7 +606,7 @@ fn unbind_single_toplevel_single_key_single_mode_differing() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_single_toplevel_single_key_multiple_modes() {
|
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 unbind_from_yaml = UnbindFromYaml { unbind };
|
||||||
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
||||||
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
||||||
@ -608,7 +614,7 @@ fn unbind_single_toplevel_single_key_multiple_modes() {
|
|||||||
keys.insert(InputMode::Pane, key_action_unbind);
|
keys.insert(InputMode::Pane, key_action_unbind);
|
||||||
let from_yaml = KeybindsFromYaml {
|
let from_yaml = KeybindsFromYaml {
|
||||||
keybinds: keys,
|
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));
|
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)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_normal_l = keybinds_from_yaml
|
let result_normal_l = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Normal)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('l'));
|
.get(&Key::Alt(CharOrArrow::Char('l')));
|
||||||
let result_pane_n = keybinds_from_yaml
|
let result_pane_n = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_pane_l = keybinds_from_yaml
|
let result_pane_l = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('l'));
|
.get(&Key::Alt(CharOrArrow::Char('l')));
|
||||||
|
|
||||||
assert!(result_normal_n.is_none());
|
assert!(result_normal_n.is_none());
|
||||||
assert!(result_normal_l.is_none());
|
assert!(result_normal_l.is_none());
|
||||||
@ -647,10 +653,10 @@ fn unbind_single_toplevel_single_key_multiple_modes() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn unbind_single_toplevel_multiple_keys_single_mode() {
|
fn unbind_single_toplevel_multiple_keys_single_mode() {
|
||||||
let unbind = Unbind::Keys(vec![
|
let unbind = Unbind::Keys(vec![
|
||||||
Key::Alt('l'),
|
Key::Alt(CharOrArrow::Char('l')),
|
||||||
Key::Alt('h'),
|
Key::Alt(CharOrArrow::Char('h')),
|
||||||
Key::Alt('j'),
|
Key::Alt(CharOrArrow::Char('j')),
|
||||||
Key::Alt('k'),
|
Key::Alt(CharOrArrow::Char('k')),
|
||||||
]);
|
]);
|
||||||
let unbind_from_yaml = UnbindFromYaml { unbind };
|
let unbind_from_yaml = UnbindFromYaml { unbind };
|
||||||
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
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);
|
keys.insert(InputMode::Pane, key_action_unbind);
|
||||||
let from_yaml = KeybindsFromYaml {
|
let from_yaml = KeybindsFromYaml {
|
||||||
keybinds: keys,
|
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));
|
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)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_normal_l = keybinds_from_yaml
|
let result_normal_l = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Normal)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('l'));
|
.get(&Key::Alt(CharOrArrow::Char('l')));
|
||||||
let result_normal_k = keybinds_from_yaml
|
let result_normal_k = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('k'));
|
.get(&Key::Alt(CharOrArrow::Char('k')));
|
||||||
let result_normal_h = keybinds_from_yaml
|
let result_normal_h = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('h'));
|
.get(&Key::Alt(CharOrArrow::Char('h')));
|
||||||
|
|
||||||
assert!(result_normal_n.is_none());
|
assert!(result_normal_n.is_none());
|
||||||
assert!(result_normal_l.is_none());
|
assert!(result_normal_l.is_none());
|
||||||
@ -697,12 +703,15 @@ fn unbind_single_toplevel_multiple_keys_single_mode() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbind_single_toplevel_multiple_keys_multiple_modes() {
|
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 {
|
let unbind_from_yaml_normal = UnbindFromYaml {
|
||||||
unbind: unbind_normal,
|
unbind: unbind_normal,
|
||||||
};
|
};
|
||||||
let key_action_unbind_normal = vec![KeyActionUnbind::Unbind(unbind_from_yaml_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 unbind_from_yaml = UnbindFromYaml { unbind };
|
||||||
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
let key_action_unbind = vec![KeyActionUnbind::Unbind(unbind_from_yaml)];
|
||||||
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
let mut keys = HashMap::<InputMode, Vec<KeyActionUnbind>>::new();
|
||||||
@ -710,7 +719,7 @@ fn unbind_single_toplevel_multiple_keys_multiple_modes() {
|
|||||||
keys.insert(InputMode::Pane, key_action_unbind);
|
keys.insert(InputMode::Pane, key_action_unbind);
|
||||||
let from_yaml = KeybindsFromYaml {
|
let from_yaml = KeybindsFromYaml {
|
||||||
keybinds: keys,
|
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));
|
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)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_normal_p = keybinds_from_yaml
|
let result_normal_p = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Normal)
|
.get(&InputMode::Normal)
|
||||||
@ -732,7 +741,7 @@ fn unbind_single_toplevel_multiple_keys_multiple_modes() {
|
|||||||
.get(&InputMode::Normal)
|
.get(&InputMode::Normal)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('l'));
|
.get(&Key::Alt(CharOrArrow::Char('l')));
|
||||||
let result_pane_p = keybinds_from_yaml
|
let result_pane_p = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
@ -744,13 +753,13 @@ fn unbind_single_toplevel_multiple_keys_multiple_modes() {
|
|||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('n'));
|
.get(&Key::Alt(CharOrArrow::Char('n')));
|
||||||
let result_pane_l = keybinds_from_yaml
|
let result_pane_l = keybinds_from_yaml
|
||||||
.0
|
.0
|
||||||
.get(&InputMode::Pane)
|
.get(&InputMode::Pane)
|
||||||
.expect("ModeKeybinds shouldn't be empty")
|
.expect("ModeKeybinds shouldn't be empty")
|
||||||
.0
|
.0
|
||||||
.get(&Key::Alt('l'));
|
.get(&Key::Alt(CharOrArrow::Char('l')));
|
||||||
|
|
||||||
assert!(result_normal_n.is_none());
|
assert!(result_normal_n.is_none());
|
||||||
assert!(result_normal_l.is_none());
|
assert!(result_normal_l.is_none());
|
||||||
|
Loading…
Reference in New Issue
Block a user