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

feat: scroll half/full page with arrow percentage supported, and new Vi-like <C-u>, <C-d>, <C-b>, and <C-f> keybindings added #213

Merged
merged 5 commits into from
Sep 24, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
..
sxyazi committed Sep 24, 2023

Verified

This commit was signed with the committer’s verified signature.
ekohl Ewoud Kohl van Wijngaarden
commit 3e617bc7d27c8585f134218f00684dbfe8cfcbd5
4 changes: 2 additions & 2 deletions config/preset/keymap.toml
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ keymap = [
{ on = [ "K" ], exec = "arrow -5", desc = "Move cursor up 5 lines" },
{ on = [ "J" ], exec = "arrow 5", desc = "Move cursor down 5 lines" },

{ on = [ "<C-u>" ], exec = "arrow -50%", desc = "Move cursor up half page" },
{ on = [ "<C-d>" ], exec = "arrow 50%", desc = "Move cursor down half page" },
{ on = [ "<C-u>" ], exec = "arrow -50%", desc = "Move cursor up half page" },
{ on = [ "<C-d>" ], exec = "arrow 50%", desc = "Move cursor down half page" },
{ on = [ "<C-b>" ], exec = "arrow -100%", desc = "Move cursor up one page" },
{ on = [ "<C-f>" ], exec = "arrow 100%", desc = "Move cursor down one page" },

3 changes: 0 additions & 3 deletions core/src/step.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ pub enum Step {
}

impl Default for Step {
#[inline]
fn default() -> Self { Self::Fixed(0) }
}

@@ -23,12 +22,10 @@ impl FromStr for Step {
}

impl From<isize> for Step {
#[inline]
fn from(n: isize) -> Self { Self::Fixed(n) }
}

impl From<usize> for Step {
#[inline]
fn from(n: usize) -> Self { Self::Fixed(n as isize) }
}