From 1e537a86d6ed0ddd3dc6fefaccc109cec63b12d3 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 9 Aug 2020 21:46:38 -0700 Subject: more toc nav --- src/view.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') 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; + } _ => (), } } -- cgit v1.2.3