aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Campos <james.r.campos@gmail.com>2021-01-04 18:25:56 -0800
committerJames Campos <james.r.campos@gmail.com>2021-01-04 18:25:56 -0800
commit8c36ebb0d040dcfa70a399cd2e71647c5d003cfe (patch)
treeaee3786ceb8ed8e7271a8f5866e37b6dbdd3127d /src
parent91647ca4c826d83210f54d29871d606b15e37c80 (diff)
downloadbk-8c36ebb0d040dcfa70a399cd2e71647c5d003cfe.tar.gz
nav -> toc
Diffstat (limited to 'src')
-rw-r--r--src/main.rs4
-rw-r--r--src/view.rs10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index fedcdc6..1b4c351 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -18,7 +18,7 @@ use std::{
use unicode_width::UnicodeWidthChar;
mod view;
-use view::{Nav, Page, Search, View};
+use view::{Toc, Page, Search, View};
mod epub;
use epub::Chapter;
@@ -146,7 +146,7 @@ impl Bk<'_> {
cols,
rows: rows as usize,
max_width: args.width,
- view: Some(if args.toc { &Nav } else { &Page }),
+ view: Some(if args.toc { &Toc } else { &Page }),
cursor: 0,
dir: Direction::Next,
meta,
diff --git a/src/view.rs b/src/view.rs
index 1bc5ca9..50af1c6 100644
--- a/src/view.rs
+++ b/src/view.rs
@@ -106,8 +106,8 @@ PageDown Right Space f l Page Down
}
}
-pub struct Nav;
-impl Nav {
+pub struct Toc;
+impl Toc {
fn prev(&self, bk: &mut Bk, n: usize) {
bk.chapter = bk.chapter.saturating_sub(n);
self.cursor(bk);
@@ -128,7 +128,7 @@ impl Nav {
}
}
}
-impl View for Nav {
+impl View for Toc {
fn on_resize(&self, bk: &mut Bk) {
self.cursor(bk);
}
@@ -238,8 +238,8 @@ impl View for Page {
Esc | Char('q') => bk.view = None,
Tab => {
bk.mark('\'');
- Nav.cursor(bk);
- bk.view = Some(&Nav);
+ Toc.cursor(bk);
+ bk.view = Some(&Toc);
}
F(_) => bk.view = Some(&Help),
Char('m') => bk.view = Some(&Mark),