Skip to content

Commit

Permalink
Add wrap_around setting
Browse files Browse the repository at this point in the history
  • Loading branch information
nh2 committed Oct 22, 2012
1 parent 9948be9 commit c8c70a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions MoveView.py
Expand Up @@ -28,15 +28,17 @@ def run(self, direction):
num_views = len(views)
target_index = index

wrap = get_setting('wrap_around', True)

if direction == 'left':
if index > 0:
index -= 1
else:
elif wrap: # Wrap around
index = num_views - 1
elif direction == 'right':
if index < num_views - 1:
index += 1
else:
elif wrap: # Wrap around
index = 0
else:
print 'Unrecognized direction:', direction + '. Use left or right.'
Expand Down

0 comments on commit c8c70a1

Please sign in to comment.