aboutsummaryrefslogtreecommitdiffstats
path: root/src/view.rs
diff options
context:
space:
mode:
authorJames Campos <james.r.campos@gmail.com>2020-08-09 21:46:38 -0700
committerJames Campos <james.r.campos@gmail.com>2020-08-09 21:46:38 -0700
commit1e537a86d6ed0ddd3dc6fefaccc109cec63b12d3 (patch)
tree3ed76f90569d04ba58d87317528f16dce781ca75 /src/view.rs
parenta932c0c254a934b9572bd4a11da57a985a7d46ad (diff)
downloadbk-1e537a86d6ed0ddd3dc6fefaccc109cec63b12d3.tar.gz
more toc nav
Diffstat (limited to 'src/view.rs')
-rw-r--r--src/view.rs16
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;
+ }
_ => (),
}
}