Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleanup.

- Removes need for except StopIteration.
  • Loading branch information...
commit 26c453445685ea74ce0be9734109e71631253c30 1 parent 6b0e40b
@DavidLGoldberg DavidLGoldberg authored
Showing with 9 additions and 11 deletions.
  1. +9 −11 git_gutter.py
View
20 git_gutter.py
@@ -28,17 +28,15 @@ def move_to_change(window, direction):
row, col = view.rowcol(view.sel()[0].begin())
- try:
- if direction == "next":
- line = next(change for change in all_changes
- if change > row + 1)
- else:
- line = next(change for change in reversed(all_changes)
- if change < row + 1)
-
- window.active_view().run_command("goto_line", {"line": line})
- except:
- pass
+ current_row = row + 1
+ if direction == "next":
+ line = next((change for change in all_changes
+ if change > current_row), current_row)
+ else:
+ line = next((change for change in reversed(all_changes)
+ if change < current_row), current_row)
+
+ window.active_view().run_command("goto_line", {"line": line})
class GitGutterNextChangeCommand(sublime_plugin.WindowCommand):
Please sign in to comment.
Something went wrong with that request. Please try again.