From e933b8483e7c2ecbd834a43834d68e4af07291e2 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 29 Jul 2020 13:12:12 -0700 Subject: fix first chapter scroll loop --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 141e353..fc761fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -650,7 +650,7 @@ impl Bk<'_> { fn scroll_up(&mut self, n: usize) { if self.line > 0 { self.line = self.line.saturating_sub(n); - } else { + } else if self.chapter > 0 { self.prev_chapter(); self.line = self.chap().lines.len().saturating_sub(self.rows); } -- cgit v1.2.3