aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 0b322c8..1792dfb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -109,9 +109,9 @@ pub struct Bk<'a> {
max_width: u16,
// view state
view: Option<&'a dyn View>,
+ cursor: usize,
dir: Direction,
meta: Vec<String>,
- nav_top: usize,
query: String,
}
@@ -147,9 +147,9 @@ impl Bk<'_> {
rows: rows as usize,
max_width: args.width,
view: Some(if args.toc { &Nav } else { &Page }),
+ cursor: 0,
dir: Direction::Next,
meta,
- nav_top: 0,
query: String::new(),
};
@@ -180,6 +180,7 @@ impl Bk<'_> {
for (i, line) in view.render(self).iter().enumerate() {
queue!(stdout, cursor::MoveTo(self.pad(), i as u16), Print(line))?;
}
+ queue!(stdout, cursor::MoveTo(self.pad(), self.cursor as u16))?;
stdout.flush().unwrap();
match event::read()? {