diff options
author | James Campos <james.r.campos@gmail.com> | 2020-08-09 21:46:38 -0700 |
---|---|---|
committer | James Campos <james.r.campos@gmail.com> | 2020-08-09 21:46:38 -0700 |
commit | 1e537a86d6ed0ddd3dc6fefaccc109cec63b12d3 (patch) | |
tree | 3ed76f90569d04ba58d87317528f16dce781ca75 /src/view.rs | |
parent | a932c0c254a934b9572bd4a11da57a985a7d46ad (diff) | |
download | bk-1e537a86d6ed0ddd3dc6fefaccc109cec63b12d3.tar.gz |
more toc nav
Diffstat (limited to 'src/view.rs')
-rw-r--r-- | src/view.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/view.rs b/src/view.rs index b3203e3..092631d 100644 --- a/src/view.rs +++ b/src/view.rs @@ -161,6 +161,22 @@ impl View for Nav { bk.chapter = bk.chapters.len() - 1; bk.nav_top = bk.chapters.len().saturating_sub(bk.rows); } + PageDown | Char('f') => { + bk.nav_top = min(bk.nav_top + bk.rows, bk.chapters.len() - 1); + bk.chapter = bk.nav_top; + } + PageUp | Char('b') => { + bk.nav_top = bk.nav_top.saturating_sub(bk.rows); + bk.chapter = bk.nav_top; + } + Char('d') => { + bk.nav_top = min(bk.nav_top + bk.rows / 2, bk.chapters.len() - 1); + bk.chapter = bk.nav_top; + } + Char('u') => { + bk.nav_top = bk.nav_top.saturating_sub(bk.rows / 2); + bk.chapter = bk.nav_top; + } _ => (), } } |