Skip to content

Commit

Permalink
Make jumping between changes loop back around
Browse files Browse the repository at this point in the history
  • Loading branch information
jisaacks committed Mar 10, 2013
1 parent 54eb786 commit b639e09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git_gutter_change.py
Expand Up @@ -34,10 +34,10 @@ def run(self):
class GitGutterNextChangeCommand(GitGutterBaseChangeCommand): class GitGutterNextChangeCommand(GitGutterBaseChangeCommand):
def jump(self, all_changes, current_row): def jump(self, all_changes, current_row):
return next((change for change in all_changes return next((change for change in all_changes
if change > current_row), current_row) if change > current_row), all_changes[0])




class GitGutterPrevChangeCommand(GitGutterBaseChangeCommand): class GitGutterPrevChangeCommand(GitGutterBaseChangeCommand):
def jump(self, all_changes, current_row): def jump(self, all_changes, current_row):
return next((change for change in reversed(all_changes) return next((change for change in reversed(all_changes)
if change < current_row), current_row) if change < current_row), all_changes[-1])

1 comment on commit b639e09

@DavidLGoldberg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Please sign in to comment.