Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replace has_key

  • Loading branch information...
commit f36714085fe463078e5e21b032818fa4d3022aaf 1 parent a14337e
@agibsonsw authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 AndyEdits.py
View
12 AndyEdits.py
@@ -285,13 +285,13 @@ def on_modified(self, view):
vid = view.id()
if not isView(vid):
return
- if not CaptureEditing.edit_info.has_key(vid):
+ if not vid in CaptureEditing.edit_info:
CaptureEditing.edit_info[vid] = {}
cview = CaptureEditing.edit_info[vid]
sel = view.sel()[0]
currA, currB = (sel.begin(), sel.end())
cview['curr_line'], _ = view.rowcol(currA)
- if not cview.has_key('prev_line') or cview['prev_line'] is None:
+ if not ('prev_line' in cview) or cview['prev_line'] is None:
# on first run, or just deleted an edit region
cview['prev_line'] = cview['curr_line']
if currA > 0 and sel.empty():
@@ -341,13 +341,13 @@ def on_selection_modified(self, view):
vid = view.id()
if not isView(vid):
return
- if not CaptureEditing.edit_info.has_key(vid):
+ if not vid in CaptureEditing.edit_info:
CaptureEditing.edit_info[vid] = {}
cview = CaptureEditing.edit_info[vid]
- if JUSTDELETED.has_key(vid) and JUSTDELETED[vid] == True:
+ if vid in JUSTDELETED and JUSTDELETED[vid] == True:
JUSTDELETED[vid], cview['prev_line'] = (False, None)
return
- if cview.has_key('prev_line') and cview['prev_line'] is not None:
+ if ('prev_line' in cview) and cview['prev_line'] is not None:
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 []
@@ -363,7 +363,7 @@ def on_selection_modified(self, view):
def on_close(self, view):
vid = view.id()
- if CaptureEditing.edit_info.has_key(vid):
+ if vid in CaptureEditing.edit_info:
del CaptureEditing.edit_info[vid]
def on_post_save(self, view):
Please sign in to comment.
Something went wrong with that request. Please try again.