diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-05-03 23:04:54 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-05-03 23:04:54 +0200 |
| commit | 4d102e069e4a0b6064a79915d368773338dbbb8e (patch) | |
| tree | b5e9bd1c287040b2f2261e6b6e0e49823a84a56f /src/window.rs | |
| parent | b0bf51b90bc233024f1b82bf3f050d26f677b935 (diff) | |
| download | mail-4d102e069e4a0b6064a79915d368773338dbbb8e.tar.gz | |
dont scroll too far
Closes #11
Diffstat (limited to 'src/window.rs')
| -rw-r--r-- | src/window.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/window.rs b/src/window.rs index 68fc258..3714c4c 100644 --- a/src/window.rs +++ b/src/window.rs @@ -57,9 +57,10 @@ impl Window { Ok(()) } - pub fn scroll_down(&mut self) { - //TODO check if we're at bottom - self.scroll += 1; + pub fn scroll_down(&mut self, until: usize) { + if self.scroll < until - 1 { + self.scroll += 1; + } } pub fn scroll_up(&mut self) { |
