Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status-bar: Reflect actual current keybindings #1242

Merged
merged 90 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
828bc29
status-bar: first_line: Use more generic var names
har7an Jun 23, 2022
a843195
status-bar: first_line: Refactor `ctrl_keys`
har7an Jun 23, 2022
82a729a
utils: conditionally compile unix-specific code
har7an Jun 27, 2022
09c6706
utils: Share more modules with wasm
har7an Jun 27, 2022
484d7a5
utils/input/keybinds_test: Fix import
har7an Jun 27, 2022
548bb87
utils/layout: Use global serde crate
har7an Jun 27, 2022
1264cb3
utils/data: Implement `fmt::Display` for `Key`
har7an Jun 27, 2022
923b33b
tile/prelude: Re-export `actions`
har7an Jun 27, 2022
6bda877
utils/data: Fix `ModeInfo::keybinds` type
har7an Jun 28, 2022
e6e6bf4
utils/data: Make `Key` sortable
har7an Jun 28, 2022
ff74417
WIP: utils/input: Make keybinds accessible
har7an Jun 28, 2022
7adffd9
utils/data: Handle unprintable chars in `Key`
har7an Jun 28, 2022
78184d7
HACK: utils/layout: Use u64 for SplitSize::Percent
har7an Jun 28, 2022
0ff8b4f
status-bar: Add helper macros
har7an Jun 28, 2022
40e79d5
status-bar/first_line: Get shared superkey if any
har7an Jun 28, 2022
5ba84fb
status-bar/first_line: Add key to KeyShortcut
har7an Jun 28, 2022
ca163cb
status-bar/first_line: Dynamically set mode binds
har7an Jun 28, 2022
a770f80
status-bar/second_line: Display configured binds
har7an Jun 28, 2022
8449fdc
WIP: utils/keybinds: Make key order deterministic
har7an Jun 28, 2022
3545fd6
utils/data: Reorder `Key` variants
har7an Jun 29, 2022
c11f8cb
status-bar/first_line: Fix inverted `matches!`
har7an Jun 29, 2022
51aaa47
status-bar: Don't get all modeswitch keybinds
har7an Jun 29, 2022
d56db92
status-bar/first_line: Fix output for tight screen
har7an Jun 29, 2022
ff8ef7b
status-bar/second_line: Remove trailing " / "
har7an Jun 30, 2022
3b75633
status-bar/second-line: Refactor key hints
har7an Jun 30, 2022
6a21a43
status-bar/second-line: Implement shortened hints
har7an Jun 30, 2022
0ba4a1b
utils/data: Fix display for `Key::Alt`
har7an Jun 30, 2022
c21c4c6
status-bar/first-line: Add hidden Tmux tile
har7an Jun 30, 2022
bc9533a
status-bar: Print superkey as part of first line
har7an Jun 30, 2022
5568673
status-bar: Rework keybinding theming
har7an Jun 30, 2022
8f65cf1
status-bar/second-line: Return new `LinePart`s
har7an Jun 30, 2022
1354bf2
status-bar/second-line: Implement adaptive behavior
har7an Jun 30, 2022
6fd6bfb
status-bar/second-line: Show float pane binding
har7an Jun 30, 2022
47ee111
status-bar/get_keys_and_hints: Add more modes
har7an Jun 30, 2022
4879ea1
status-bar/second-line: Unify mode handling
har7an Jun 30, 2022
e8d3c0c
status-bar/first-line: Refactor common modifier
har7an Jun 30, 2022
b0a6ecd
status-bar/second-line: Display modifier in hints
har7an Jun 30, 2022
6dd8d89
utils/ipc: Remove `Copy` from `ClientAttributes`
har7an Jul 4, 2022
b4ae898
utils/input/keybinds: Fix import path
har7an Jul 4, 2022
50236ac
utils/ipc: Add `Keybinds` to `ClientAttributes`
har7an Jul 4, 2022
6b1507f
server/lib: Store `ClientAttributes` over `Style`
har7an Jul 4, 2022
e0e3a52
utils/input: Change `get_mode_info` parameters
har7an Jul 4, 2022
bf6b5f6
utils/ipc: Use `rmp` for serde of IPC messages
har7an Jul 4, 2022
04bae29
fix(nix): remove `assets` from `gitignore`
a-kenji Jul 4, 2022
0b3a034
tests/e2e: Fix status bar in snapshots
har7an Jul 7, 2022
6a0b982
status_bar/first_line: Don't show unbound modes
har7an Jul 7, 2022
62b12ac
utils/data: Make 'Key::Char(' ') visible as "␣"
har7an Jul 7, 2022
9bb990d
status_bar/second_line: Remove extra hints
har7an Jul 7, 2022
f1bf0d2
utils/data: format unprintable chars as words
har7an Jul 8, 2022
05962d0
utils/data: Fix display for `Ctrl`/`Alt` keys
har7an Jul 10, 2022
36f5fea
utils/data: Change order of `Key`s
har7an Jul 10, 2022
636fb3c
status_bar/first_line: Don't ignore default char
har7an Jul 10, 2022
13af73d
status_bar/first_line: Add space when no modifier
har7an Jul 10, 2022
76dfc5c
status_bar/second_line: Print separators
har7an Jul 10, 2022
a92ae99
status_bar/main: Don't return modifier if empty
har7an Jul 10, 2022
4815ba3
status_bar/first_line: Don't suppress Disabled tiles
har7an Jul 13, 2022
1969dd0
status_bar/first_line: Don't print leading triangle
har7an Jul 13, 2022
5d1a7ee
status_bar/second_line: Add exceptions
har7an Jul 13, 2022
07d0d60
status_bar/main: Refactor `action_key`
har7an Jul 14, 2022
0acbe10
status_bar/first_line: Fix "triangle" for short tiles
har7an Jul 14, 2022
455b75b
status_bar/second_line: Fix typo
har7an Jul 14, 2022
4715cd5
status_bar/second_line: Fix char count
har7an Jul 14, 2022
ead39c3
status_bar: Use new `action_key` fn
har7an Jul 14, 2022
9190c27
status_bar/second_line: Fix floating pane hint
har7an Jul 14, 2022
20a60db
utils: Send full keybinds in `ModeInfo`
har7an Jul 14, 2022
b438022
utils: Refactor keybinds vec into type
har7an Jul 14, 2022
68a1326
status_bar/first_line: Remove needless borrows
har7an Jul 14, 2022
332596f
status_bar: Factor out printing keybindings
har7an Jul 14, 2022
6a3f2ad
status_bar/tip: Use real keybindings
har7an Jul 14, 2022
7e0a37f
status_bar: abort early when keyvector is empty
har7an Jul 15, 2022
07c586b
status_bar/tip: Fix all keybindings
har7an Jul 15, 2022
569b334
status_bar: Go clippy!
har7an Jul 15, 2022
34658d9
status_bar: Add documentation
har7an Jul 18, 2022
8606c4e
status_bar/tip: Detect when key aren't bound
har7an Jul 18, 2022
5bd2ad9
status_bar/first_line: Show bindings when locked
har7an Jul 18, 2022
a34f7ef
status_bar: Don't consider 'hl', 'jk' groups
har7an Jul 18, 2022
52e5cd4
status_bar/second_line: Add "search" keybindings
har7an Jul 19, 2022
da05202
tests/e2e: Fix snapshots
har7an Jul 19, 2022
52ef7a0
status_bar: Remove old comments
har7an Jul 21, 2022
1b373ae
status_bar/first_line: Rename 'long_tile'
har7an Jul 21, 2022
2e62513
status_bar/first_line: Fix spacing in simple UI
har7an Jul 21, 2022
0513979
status_bar: Refactor and rename `ctrl_keys`
har7an Jul 21, 2022
8891778
status_bar: Add unit tests to shared functions
har7an Jul 21, 2022
3a06d5f
status_bar/first_line: Rename functions
har7an Jul 22, 2022
a9327f6
status_bar/tips: Remove stray "/" in quicknav tip
har7an Jul 22, 2022
1d8ef80
utils/layout: Remove old comments
har7an Jul 22, 2022
96b28d7
status_bar: Add "regex" as test dependency
har7an Jul 22, 2022
80a84a3
status_bar: Implement unit tests
har7an Jul 22, 2022
dc7ed86
Makefile: Always run tests on host triple
har7an Jul 26, 2022
e2544bd
tests/e2e: Add test for custom bindings
har7an Jul 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ flake-utils.lib.eachSystem [
};
cargo = rustToolchainToml;
rustc = rustToolchainToml;
cargoMSRV = msrvToolchain;
rustcMSRV = msrvToolchain;

buildInputs = [
# in order to run tests
Expand Down Expand Up @@ -163,6 +165,7 @@ flake-utils.lib.eachSystem [
license = [licenses.mit];
};
in rec {
packages.default = packages.zellij-native;
# crate2nix - better incremental builds, but uses ifd
packages.zellij = crate2nixPkgs.callPackage ./crate2nix.nix {
inherit
Expand All @@ -177,7 +180,7 @@ in rec {
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
};

packages.zellij-msrv = crate2nixMsrvPkgs.callPackage ./crate2nix.nix {
packages.zellij-crate-msrv = crate2nixMsrvPkgs.callPackage ./crate2nix.nix {
inherit
name
src
Expand All @@ -204,7 +207,25 @@ in rec {
;
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
};
packages.default = packages.zellij;
# native nixpkgs support - msrv
packages.zellij-msrv =
(pkgs.makeRustPlatform {
cargo = cargoMSRV;
rustc = rustcMSRV;
})
.buildRustPackage {
inherit
src
name
cargoLock
buildInputs
postInstall
patchPhase
desktopItems
meta
;
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
};

packages.plugins-compact = plugins.compact-bar;
packages.plugins-status-bar = plugins.status-bar;
Expand Down
1 change: 0 additions & 1 deletion .nix/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
ignoreSource = [
".git"
".github"
"assets"
"docs"
"example"
"target"
Expand Down
31 changes: 30 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 21 additions & 11 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@ dependencies = [
"clippy",
]

# Patching the default flows to skip testing of wasm32-wasi targets
[tasks.pre-test]
condition = { env = { "CARGO_MAKE_CRATE_TARGET_TRIPLE" = "wasm32-wasi" } }
env = { "SKIP_TEST" = true }

[tasks.test]
condition = { env_false = ["SKIP_TEST"] }
dependencies = ["pre-test"]
args = ["test", "--", "@@split(CARGO_MAKE_TASK_ARGS,;)"]

[tasks.post-test]
env = { "SKIP_TEST" = false }
dependencies = ["get-host-triple"]
args = ["test", "--target", "${CARGO_HOST_TRIPLE}", "--", "@@split(CARGO_MAKE_TASK_ARGS,;)"]

# Running Zellij using the development data directory
[tasks.run]
Expand Down Expand Up @@ -125,6 +116,25 @@ env = { "CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS" = [
] }
run_task = { name = "build", fork = true }

[tasks.get-host-triple]
script_runner = "@duckscript"
script = '''
output = exec rustc -v -V
lines = split ${output.stdout} \n
triple = set ""
for line in ${lines}
if starts_with ${line} "host:" && not is_empty ${line}
bits = split ${line} " "
triple = array_get ${bits} 1
triple = set ${triple}
end
end

if not is_empty ${triple}
set_env CARGO_HOST_TRIPLE "${triple}"
end
'''

[tasks.wasm-opt-plugins]
dependencies = ["build-plugins-release"]
script_runner = "@duckscript"
Expand Down
3 changes: 3 additions & 0 deletions default-plugins/status-bar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ serde_json = "1.0"
thiserror = "1.0.30"
zellij-tile = { path = "../../zellij-tile" }
zellij-tile-utils = { path = "../../zellij-tile-utils" }

[dev-dependencies]
regex = "1"
Loading