Fix scrolling to negative offsets

This commit is contained in:
Anthony Sottile
2019-09-13 17:32:47 -07:00
parent 47e8aa0145
commit a0b7eb2f9c
2 changed files with 20 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ class Position:
def maybe_scroll_up(self, margin: Margin) -> None:
if self.cursor_line < self.file_line:
self.file_line -= self._scroll_amount()
self.file_line = max(self.file_line, 0)
def up(self, margin: Margin, lines: List[str]) -> None:
if self.cursor_line > 0: