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
52 changes: 26 additions & 26 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,32 @@ jobs:
name: yazi-${{ matrix.arch }}.snap
path: yazi-${{ matrix.arch }}.snap

snap:
runs-on: ubuntu-latest
needs: [build-snap]
steps:
- uses: actions/download-artifact@v4
with:
pattern: yazi-*.snap
merge-multiple: true

- name: Setup snapcraft
run: sudo snap install --classic snapcraft

- name: Push snap to candidate channel
if: startsWith(github.ref, 'refs/tags/')
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: |
parallel 'snapcraft push -v --release latest/candidate {}' ::: yazi-*.snap

- name: Push snap to edge channel
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: |
parallel 'snapcraft push -v --release latest/edge {}' ::: yazi-*.snap

draft:
if: startsWith(github.ref, 'refs/tags/')
permissions:
Expand Down Expand Up @@ -232,29 +258,3 @@ jobs:
name: Nightly Build
body: ${{ env.NIGHTLY_BODY }}
target_commitish: ${{ github.sha }}

snap:
runs-on: ubuntu-latest
needs: [build-snap]
steps:
- uses: actions/download-artifact@v4
with:
pattern: yazi-*.snap
merge-multiple: true

- name: Setup snapcraft
run: sudo snap install --classic snapcraft

- name: Push snap to candidate channel
if: startsWith(github.ref, 'refs/tags/')
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: |
parallel 'snapcraft push -v --release latest/candidate {}' ::: yazi-*.snap

- name: Push snap to edge channel
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: |
parallel 'snapcraft push -v --release latest/edge {}' ::: yazi-*.snap
6 changes: 5 additions & 1 deletion yazi-config/preset/keymap-default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,13 @@ keymap = [
{ on = "a", run = "insert --append", desc = "Enter append mode" },
{ on = "A", run = [ "move eol", "insert --append" ], desc = "Move to the EOL, and enter append mode" },
{ on = "v", run = "visual", desc = "Enter visual mode" },
{ on = "V", run = [ "move bol", "visual", "move eol" ], desc = "Enter visual mode and select all" },
{ on = "r", run = "replace", desc = "Replace a single character" },

# Selection
{ on = "V", run = [ "move bol", "visual", "move eol" ], desc = "Select from BOL to EOL" },
{ on = "<C-A>", run = [ "move eol", "visual", "move bol" ], desc = "Select from EOL to BOL" },
{ on = "<C-E>", run = [ "move bol", "visual", "move eol" ], desc = "Select from BOL to EOL" },

# Character-wise movement
{ on = "h", run = "move -1", desc = "Move back a character" },
{ on = "l", run = "move 1", desc = "Move forward a character" },
Expand Down
15 changes: 7 additions & 8 deletions yazi-core/src/input/commands/visual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ use yazi_shared::event::CmdCow;
use crate::input::{Input, InputMode, op::InputOp};

impl Input {
#[inline]
pub fn visual(&mut self, _: CmdCow) {
let snap = self.snap_mut();
if snap.mode != InputMode::Normal {
return;
} else if snap.value.is_empty() {
return;
if self.snap().mode != InputMode::Normal {
self.escape(());
}

snap.op = InputOp::Select(snap.cursor);
render!();
let snap = self.snap_mut();
if !snap.value.is_empty() {
snap.op = InputOp::Select(snap.cursor);
render!();
}
}
}
2 changes: 2 additions & 0 deletions yazi-fm/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ impl<'a> Executor<'a> {
}
}
InputMode::Insert => {
on!(visual);

on!(backspace);
on!(kill);
}
Expand Down
Loading