Fixed a bug when paging the summary.

This commit is contained in:
Andrew Hamilton 2017-07-08 14:22:45 +01:00
parent acfc0249f4
commit 8ecd50848d
2 changed files with 6 additions and 10 deletions

4
BUGS
View file

@ -6,8 +6,6 @@ Current
the timed out status when un-paused.
- Tmp files are being left behind after shutdown.
- All tools in AppImages aren't working correctly. See ./vigil --self_test
- When paging the summary window the cursor line should stay in the same
place on the screen.
- Sometimes git_blame produces an error, depending on characters in its
input.
@ -252,6 +250,8 @@ Fixed
is a glitch in the scrolling.
- When paging the summary window, with the bottom scroll bar showing, the
cursor line drifts up or down a row.
- When paging the summary window the cursor line should stay in the same
place on the screen.
Won't fix

View file

@ -336,7 +336,7 @@ class Summary:
return self._highlight_cursor_row(
self._view_widget.appearance(dimensions), cursor_y)
def mouse_scroll(self, dx, dy):
def scroll(self, dx, dy):
scroll_x, scroll_y = self._view_widget.position
dy = min(dy, scroll_y)
self._view_widget.position = scroll_x, scroll_y - dy
@ -375,15 +375,11 @@ class Summary:
def cursor_page_up(self):
view_width, view_height = self._view_widget.portal.last_dimensions
x, y = self._cursor_position
jump = view_height - 1
self._cursor_position = (x, max(y - jump, 0))
self.scroll(0, view_height)
def cursor_page_down(self):
view_width, view_height = self._view_widget.portal.last_dimensions
x, y = self._cursor_position
jump = view_height - 1
self._cursor_position = (x, min(y + jump, len(self._column) - 1))
self.scroll(0, -view_height)
def cursor_home(self):
x, y = self._cursor_position
@ -796,7 +792,7 @@ class Screen:
last_x, last_y = self._last_mouse_position
dx, dy = x - last_x, y - last_y
if self._is_summary_focused:
self._summary.mouse_scroll(dx, dy)
self._summary.scroll(dx, dy)
else:
self._move_listing((-dx, -dy))
else: # Mouse press