Skip to content

Commit

Permalink
Fix issue with filtering navigation + more linting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
and3rson committed Aug 9, 2018
1 parent 3939414 commit c271cec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions clay/pages/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ def keypress(self, size, key):
self.focus_position = 2
else:
self.focus_position = 0
else:
return super(SearchPage, self).keypress(size, key)
return None
return super(SearchPage, self).keypress(size, key)
9 changes: 7 additions & 2 deletions clay/songlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,14 @@ def get_item(matches, current_index, callback):
order.reverse()

items = [item for item in matches if callback(item.index, current_index)]

# Please witness some terrible code below.

index = -1 if callback is lt else 0

if items:
return items[-1].index, order[0]
return matches[-1].index, order[1]
return items[index].index, order[0]
return matches[index].index, order[1]

def mouse_event(self, size, event, button, col, row, focus):
"""
Expand Down

0 comments on commit c271cec

Please sign in to comment.