cleanup
This commit is contained in:
parent
444f12cb32
commit
ec10ac992a
1 changed files with 1 additions and 8 deletions
|
@ -279,17 +279,10 @@ impl Editor {
|
|||
}
|
||||
|
||||
fn scroll_to_cursor(&mut self) {
|
||||
// while self.cursor.line < self.scroll {
|
||||
// self.scroll -= 1;
|
||||
// }
|
||||
// while self.cursor.line > (self.scroll + terminal::size().unwrap().1 as usize - 2) {
|
||||
// self.scroll += 1;
|
||||
// }
|
||||
self.scroll = self.scroll.min(self.cursor.line);
|
||||
let height = terminal::size().unwrap().1 as usize - 2;
|
||||
self.scroll = self
|
||||
.scroll
|
||||
.max(self.scroll + self.cursor.line.saturating_sub(self.scroll + height));
|
||||
.clamp(self.cursor.line.saturating_sub(height), self.cursor.line);
|
||||
}
|
||||
|
||||
fn move_home(&mut self) {
|
||||
|
|
Loading…
Reference in a new issue