Permalink
Browse files

Minor improvement

  • Loading branch information...
1 parent 5e0ea6e commit 5b1f7d4837366b6ef0cbe1289a89c0622e43fe82 @agibsonsw committed Oct 13, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 AndyEdits.py
View
5 AndyEdits.py
@@ -333,12 +333,11 @@ def on_selection_modified(self, view):
curr_line, _ = view.rowcol(view.sel()[0].begin())
if (cview['prev_line'] != curr_line) and (cview['lastx'] < cview['lasty']):
edited = view.get_regions('edited_rgns') or []
- prev_reg = sublime.Region(cview['lastx'], cview['lasty'])
for i, r in enumerate(edited):
- if r.contains(prev_reg):
+ if r.begin() >= cview['lastx'] and r.end() <= cview['lasty']:
break
else:
- edited.append(prev_reg)
+ edited.append(sublime.Region(cview['lastx'], cview['lasty']))
view.add_regions("edited_rgns", edited, ICONSCOPE, \
ICON, sublime.HIDDEN | sublime.PERSISTENT)
cview['prev_line'] = None

0 comments on commit 5b1f7d4

Please sign in to comment.