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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cachix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Install Nix
uses: cachix/install-nix-action@v31
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Setup Rust toolchain
run: |
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Setup Rust toolchain
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
stylua:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- uses: JohnnyMorganz/stylua-action@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER: riscv64-linux-gnu-gcc
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER: sparc64-linux-gnu-gcc
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Install gcc
if: matrix.gcc != ''
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: lld-link.exe
CARGO_TARGET_AARCH64_PC_WINDOWS_MSVC_LINKER: lld-link.exe
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
container:
image: docker://ghcr.io/cross-rs/${{ matrix.target }}:edge
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
fetch-depth: 0

Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:
echo "Nightly changelog: https://github.com/sxyazi/yazi/blob/main/CHANGELOG.md#unreleased" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: actions/download-artifact@v8
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Setup Rust toolchain
run: rustup toolchain install stable --profile minimal
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
permissions:
issues: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):

- Drag and drop ([#4005])
- Bulk create ([#3793])
- Make help menu a command palette ([#4074])
- Dynamic keymap Lua API ([#4031])
- New `ui.Input` element ([#4040])
- Image preview with Überzug++ on Niri ([#3990])
Expand All @@ -24,6 +25,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):
### Changed

- Rename `<BackTab>` to `<S-Tab>` ([#3989])
- Remove `help:filter` action since the filter input is now always available ([#4074])
- `[help]` of `theme.toml`: supersede `on` with `chord`, supersede `run` and `desc` with `action`, remove `footer` ([#4074])
- Remove Legacy Console Mode on Windows ([#3989])

### Deprecated
Expand Down Expand Up @@ -1757,3 +1760,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):
[#4065]: https://github.com/sxyazi/yazi/pull/4065
[#4067]: https://github.com/sxyazi/yazi/pull/4067
[#4068]: https://github.com/sxyazi/yazi/pull/4068
[#4074]: https://github.com/sxyazi/yazi/pull/4074
20 changes: 10 additions & 10 deletions Cargo.lock

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

25 changes: 25 additions & 0 deletions yazi-actor/src/help/close.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use anyhow::Result;
use yazi_macro::{emit, render, succ};
use yazi_parser::help::CloseForm;
use yazi_shared::data::Data;

use crate::{Actor, Ctx};

pub struct Close;

impl Actor for Close {
type Form = CloseForm;

const NAME: &str = "close";

fn act(cx: &mut Ctx, opt: Self::Form) -> Result<Data> {
let help = &mut cx.help;

if let Some(chord) = help.bindings.get(help.cursor).filter(|_| opt.submit) {
emit!(Seq(chord.to_seq(help.layer)));
}

help.visible = false;
succ!(render!());
}
}
11 changes: 4 additions & 7 deletions yazi-actor/src/help/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::VoidForm;
use yazi_shared::data::Data;
use yazi_widgets::input::InputMode;

use crate::{Actor, Ctx};

Expand All @@ -13,15 +14,11 @@ impl Actor for Escape {
const NAME: &str = "escape";

fn act(cx: &mut Ctx, _: Self::Form) -> Result<Data> {
if cx.help.keyword().is_none() {
return act!(help:toggle, cx, cx.help.layer);
if cx.help.input.mode() == InputMode::Normal {
return act!(help:close, cx);
}

let help = &mut cx.help;
help.keyword = String::new();
help.in_filter = None;
help.filter_apply();

act!(escape, cx.help.input)?;
succ!(render!());
}
}
22 changes: 0 additions & 22 deletions yazi-actor/src/help/filter.rs

This file was deleted.

2 changes: 1 addition & 1 deletion yazi-actor/src/help/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yazi_macro::mod_flat!(arrow escape filter toggle);
yazi_macro::mod_flat!(arrow close escape toggle);
20 changes: 15 additions & 5 deletions yazi-actor/src/help/toggle.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use anyhow::Result;
use ratatui_core::layout::Margin;
use yazi_config::popup::Help;
use yazi_macro::{render, succ};
use yazi_parser::help::ToggleForm;
use yazi_shared::data::Data;
use yazi_widgets::input::Input;

use crate::{Actor, Ctx};

Expand All @@ -13,17 +16,24 @@ impl Actor for Toggle {
const NAME: &str = "toggle";

fn act(cx: &mut Ctx, form: Self::Form) -> Result<Data> {
let help = &mut cx.help;
let position = Help::position();
let area = cx.mgr.area(position);
let input_area = area.inner(Margin::new(1, 1));

help.visible = !help.visible;
let help = &mut cx.help;
help.visible = true;
help.layer = form.layer;
help.position = position;
help.height = area.height;

help.keyword = String::new();
help.in_filter = None;
help.filter_apply();
help.input = Input::default();
help.input.repos(input_area);

help.keyword.clear();
help.offset = 0;
help.cursor = 0;
help.filter_apply();

succ!(render!());
}
}
2 changes: 1 addition & 1 deletion yazi-actor/src/lives/which.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ impl Which {
impl UserData for Which {
fn add_fields<F: UserDataFields<Self>>(fields: &mut F) {
fields.add_cached_field("tx", |_, me| Ok(me.tx.clone().map(yazi_binding::MpscUnboundedTx)));
fields.add_field_method_get("times", |_, me| Ok(me.inner.times));
fields.add_cached_field("cands", |lua, me| {
lua.create_sequence_from(me.inner.cands.iter().cloned())
});
fields.add_field_method_get("times", |_, me| Ok(me.inner.times));

fields.add_field_method_get("active", |_, me| Ok(me.inner.active));
fields.add_field_method_get("silent", |_, me| Ok(me.inner.silent));
Expand Down
3 changes: 2 additions & 1 deletion yazi-actor/src/which/activate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ impl Actor for Activate {

let which = &mut cx.which;
which.tx = opt.tx;
which.times = opt.times;
which.layer = opt.layer;
which.cands = opt.cands;
which.times = opt.times;

which.active = true;
which.silent = opt.silent;
Expand Down
2 changes: 1 addition & 1 deletion yazi-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ proc-macro = true
[dependencies]
# External dependencies
proc-macro2 = "1"
quote = "1.0.45"
quote = "1.0.46"
syn = { version = "2.0.118", features = [ "full" ] }
11 changes: 6 additions & 5 deletions yazi-config/preset/keymap-default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,10 @@ keymap = [
[help]

keymap = [
{ on = "<Esc>", run = "escape", desc = "Clear the filter, or hide the help" },
{ on = "<C-[>", run = "escape", desc = "Clear the filter, or hide the help" },
{ on = "<C-c>", run = "close", desc = "Hide the help" },
{ on = "<Esc>", run = "escape", desc = "Enter normal mode, or hide help menu" },
{ on = "<C-[>", run = "escape", desc = "Enter normal mode, or hide help menu" },
{ on = "<C-c>", run = "close", desc = "Close help menu" },
{ on = "<Enter>", run = "close --submit", desc = "Close help menu and run selected action(s)" },

# Navigation
{ on = "k", run = "arrow prev", desc = "Previous line" },
Expand All @@ -371,6 +372,6 @@ keymap = [
{ on = "<Up>", run = "arrow prev", desc = "Previous line" },
{ on = "<Down>", run = "arrow next", desc = "Next line" },

# Filtering
{ on = "f", run = "filter", desc = "Filter help items" },
{ on = "<C-p>", run = "arrow prev", desc = "Previous line" },
{ on = "<C-n>", run = "arrow next", desc = "Next line" },
]
7 changes: 3 additions & 4 deletions yazi-config/preset/theme-dark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,10 @@ hovered = { fg = "magenta", bold = true }
# : Help menu {{{

[help]
on = { fg = "cyan" }
run = { fg = "magenta" }
desc = {}
border = { fg = "blue" }
chord = { fg = "cyan" }
action = {}
hovered = { reversed = true, bold = true }
footer = { fg = "black", bg = "white" }

# : }}}

Expand Down
7 changes: 3 additions & 4 deletions yazi-config/preset/theme-light.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,10 @@ hovered = { fg = "magenta", bold = true }
# : Help menu {{{

[help]
on = { fg = "cyan" }
run = { fg = "magenta" }
desc = {}
border = { fg = "blue" }
chord = { fg = "cyan" }
action = {}
hovered = { reversed = true, bold = true }
footer = { fg = "black", bg = "white" }

# : }}}

Expand Down
Loading
Loading