Skip to content

Commit

Permalink
Keep search results in view above the search window.
Browse files Browse the repository at this point in the history
  • Loading branch information
firecat53 committed Mar 4, 2015
1 parent 17eb9b3 commit 2791623
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tabview/tabview.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def home(self):
def goto_y(self, y):
y = max(min(len(self.data), y), 1)
if self.win_y < y <= self.win_y + \
(self.max_y - self.header_offset):
(self.max_y - self.header_offset - self._search_win_open):
# same screen, change y appropriately.
self.y = y - 1 - self.win_y
elif y <= self.win_y:
Expand All @@ -272,8 +272,10 @@ def goto_y(self, y):
self.win_y = y - 1
else:
# going forward
self.win_y = y - (self.max_y - self.header_offset)
self.y = (self.max_y - self.header_offset) - 1
self.win_y = y - (self.max_y - self.header_offset -
self._search_win_open)
self.y = (self.max_y - self.header_offset -
self._search_win_open) - 1

def goto_row(self):
m = self.consume_modifier(len(self.data))
Expand Down

0 comments on commit 2791623

Please sign in to comment.