Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
max_row check
  • Loading branch information
colinta committed Mar 6, 2012
1 parent ac8f458 commit 9ab82c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions move_text.py
Expand Up @@ -69,8 +69,11 @@ def move_text_vert(self, region, edit, direction):

dest_row = row + direction

if dest_row < 0 or dest_row > self.view.rowcol(self.view.size())[0]:
return
max_row = self.view.rowcol(self.view.size())[0]
if dest_row < 0:
dest_row = 0
elif dest_row > max_row:
dest_row = max_row

self.view.sel().subtract(orig_region)
self.view.replace(edit, region, '')
Expand Down

0 comments on commit 9ab82c9

Please sign in to comment.