Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/Pythonwin/pywin/scintilla
Modified Files:
IDLEenvironment.py bindings.py control.py view.py
Log Message:
Various modernizations to .py code via the py3k branch.
Index: control.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** control.py 2 Sep 2008 23:03:38 -0000 1.18
--- control.py 14 Nov 2008 00:22:25 -0000 1.19
***************
*** 6,9 ****
--- 6,10 ----
from pywin.mfc import window
+ from pywin import default_scintilla_encoding
import win32con
import win32ui
***************
*** 13,16 ****
--- 14,18 ----
import string
import os
+ import sys
import scintillacon
***************
*** 59,63 ****
def SCIAddText(self, text):
! self.SendMessage(scintillacon.SCI_ADDTEXT, buffer(text))
def SCIAddStyledText(self, text, style = None):
# If style is None, text is assumed to be a "native" Scintilla buffer.
--- 61,65 ----
def SCIAddText(self, text):
! self.SendMessage(scintillacon.SCI_ADDTEXT, text.encode(default_scintilla_encoding))
def SCIAddStyledText(self, text, style = None):
# If style is None, text is assumed to be a "native" Scintilla buffer.
***************
*** 65,75 ****
# assumed to apply to the entire string.
if style is not None:
! text = map(lambda char, style=style: char+chr(style), text)
text = ''.join(text)
! self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, buffer(text))
def SCIInsertText(self, text, pos=-1):
! sma = array.array('c', text+"\0")
! (a,l) = sma.buffer_info()
! self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, a)
def SCISetSavePoint(self):
self.SendScintilla(scintillacon.SCI_SETSAVEPOINT)
--- 67,76 ----
# assumed to apply to the entire string.
if style is not None:
! text = list(map(lambda char, style=style: char+chr(style), text))
text = ''.join(text)
! self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, text.encode(default_scintilla_encoding))
def SCIInsertText(self, text, pos=-1):
! buff=(text+'\0').encode(default_scintilla_encoding)
! self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, buff)
def SCISetSavePoint(self):
self.SendScintilla(scintillacon.SCI_SETSAVEPOINT)
***************
*** 108,114 ****
return self.SendScintilla(scintillacon.SCI_STYLESETEOLFILLED, num, v)
def SCIStyleSetFont(self, num, name, characterset=0):
! buff = array.array('c', name + "\0")
! addressBuffer = buff.buffer_info()[0]
! self.SendScintilla(scintillacon.SCI_STYLESETFONT, num, addressBuffer)
self.SendScintilla(scintillacon.SCI_STYLESETCHARACTERSET, num, characterset)
def SCIStyleSetBold(self, num, bBold):
--- 109,114 ----
return self.SendScintilla(scintillacon.SCI_STYLESETEOLFILLED, num, v)
def SCIStyleSetFont(self, num, name, characterset=0):
! buff = (name + "\0").encode(default_scintilla_encoding)
! self.SendScintilla(scintillacon.SCI_STYLESETFONT, num, buff)
self.SendScintilla(scintillacon.SCI_STYLESETCHARACTERSET, num, characterset)
def SCIStyleSetBold(self, num, bBold):
***************
*** 181,187 ****
if type(text) in [type([]), type(())]:
text = ' '.join(text)
! buff = array.array('c', text + "\0")
! addressBuffer = buff.buffer_info()[0]
! return self.SendScintilla(scintillacon.SCI_AUTOCSHOW, 0, addressBuffer)
def SCIAutoCCancel(self):
self.SendScintilla(scintillacon.SCI_AUTOCCANCEL)
--- 181,186 ----
if type(text) in [type([]), type(())]:
text = ' '.join(text)
! buff = (text + "\0").encode(default_scintilla_encoding)
! return self.SendScintilla(scintillacon.SCI_AUTOCSHOW, 0, buff)
def SCIAutoCCancel(self):
self.SendScintilla(scintillacon.SCI_AUTOCCANCEL)
***************
*** 191,197 ****
return self.SendScintilla(scintillacon.SCI_AUTOCCOMPLETE)
def SCIAutoCStops(self, stops):
! buff = array.array('c', stops + "\0")
! addressBuffer = buff.buffer_info()[0]
! self.SendScintilla(scintillacon.SCI_AUTOCSTOPS, 0, addressBuffer)
def SCIAutoCSetAutoHide(self, hide):
self.SendScintilla(scintillacon.SCI_AUTOCSETAUTOHIDE, hide)
--- 190,195 ----
return self.SendScintilla(scintillacon.SCI_AUTOCCOMPLETE)
def SCIAutoCStops(self, stops):
! buff = (stops + "\0").encode(default_scintilla_encoding)
! self.SendScintilla(scintillacon.SCI_AUTOCSTOPS, 0, buff)
def SCIAutoCSetAutoHide(self, hide):
self.SendScintilla(scintillacon.SCI_AUTOCSETAUTOHIDE, hide)
***************
*** 219,225 ****
# Lexer etc
def SCISetKeywords(self, keywords, kw_list_no = 0):
! ar = array.array('c', keywords+"\0")
! (a,l) = ar.buffer_info()
! self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, a)
def SCISetProperty(self, name, value):
name_buff = array.array('c', name + "\0")
--- 217,222 ----
# Lexer etc
def SCISetKeywords(self, keywords, kw_list_no = 0):
! buff = (keywords+"\0").encode(default_scintilla_encoding)
! self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, buff)
def SCISetProperty(self, name, value):
name_buff = array.array('c', name + "\0")
***************
*** 280,290 ****
"""
findtextex_fmt='llPll'
! buff = array.array('c', findText + "\0")
! addressBuffer = buff.buffer_info()[0]
! ft = struct.pack(findtextex_fmt, range[0], range[1], addressBuffer, 0, 0)
! ftBuff = array.array('c', ft)
! addressFtBuff = ftBuff.buffer_info()[0]
! rc = self.SendScintilla(EM_FINDTEXTEX, flags, addressFtBuff)
! ftUnpacked = struct.unpack(findtextex_fmt, ftBuff.tostring())
return rc, (ftUnpacked[3], ftUnpacked[4])
--- 277,287 ----
"""
findtextex_fmt='llPll'
! ## Scintilla does not handle unicode in EM_FINDTEXT msg (FINDTEXTEX struct)
! txt_buff = (findText+'\0').encode(default_scintilla_encoding)
! txt_array = array.array('b', txt_buff)
! ft_buff = struct.pack(findtextex_fmt, range[0], range[1], txt_array.buffer_info()[0], 0, 0)
! ft_array = array.array('b', ft_buff)
! rc = self.SendScintilla(EM_FINDTEXTEX, flags, ft_array.buffer_info()[0])
! ftUnpacked = struct.unpack(findtextex_fmt, ft_array)
return rc, (ftUnpacked[3], ftUnpacked[4])
***************
*** 303,307 ****
addressTxtBuf = txtBuf.buffer_info()[0]
self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf)
! return txtBuf.tostring()[:-1]
def SetSel(self, start=0, end=None):
--- 300,304 ----
addressTxtBuf = txtBuf.buffer_info()[0]
self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf)
! return txtBuf.tostring().decode(default_scintilla_encoding)
def SetSel(self, start=0, end=None):
***************
*** 347,363 ****
assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid"
assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid"
! initer = "=" * (end - start + 1)
! buff = array.array('c', initer)
addressBuffer = buff.buffer_info()[0]
tr = struct.pack('llP', start, end, addressBuffer)
! trBuff = array.array('c', tr)
addressTrBuff = trBuff.buffer_info()[0]
numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff)
! return buff.tostring()[:numChars]
!
def ReplaceSel(self, str):
! buff = array.array('c', str + "\0")
! self.SendScintilla(scintillacon.SCI_REPLACESEL, 0, buff.buffer_info()[0]);
! buff = None
def GetLine(self, line=-1):
--- 344,363 ----
assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid"
assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid"
! initer = ("=" * (end - start + 1)).encode("ascii") # ensure bytes in both 2x and 3k
! if sys.version_info >= (3,):
! byte_format = 'b'
! else:
! byte_format = 'c'
! buff = array.array(byte_format, initer)
addressBuffer = buff.buffer_info()[0]
tr = struct.pack('llP', start, end, addressBuffer)
! trBuff = array.array(byte_format, tr)
addressTrBuff = trBuff.buffer_info()[0]
numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff)
! return buff.tostring()[:numChars].decode(default_scintilla_encoding)
!
def ReplaceSel(self, str):
! buff = (str + "\0").encode(default_scintilla_encoding)
! self.SendScintilla(scintillacon.SCI_REPLACESEL, 0, buff)
def GetLine(self, line=-1):
***************
*** 377,382 ****
def SetWordWrap(self, mode):
! if mode <> win32ui.CRichEditView_WrapNone:
! raise ValueError, "We dont support word-wrap (I dont think :-)"
class CScintillaColorEditInterface(CScintillaEditInterface):
--- 377,382 ----
def SetWordWrap(self, mode):
! if mode != win32ui.CRichEditView_WrapNone:
! raise ValueError("We dont support word-wrap (I dont think :-)")
class CScintillaColorEditInterface(CScintillaEditInterface):
Index: view.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** view.py 3 Sep 2008 02:59:44 -0000 1.29
--- view.py 14 Nov 2008 00:22:25 -0000 1.30
***************
*** 194,200 ****
doc = self.GetDocument()
! # Enable Unicode if we can
! if is_platform_unicode:
! self.SendScintilla(scintillacon.SCI_SETCODEPAGE, scintillacon.SC_CP_UTF8, 0)
# Create margins
self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 1, scintillacon.SC_MARGIN_SYMBOL);
--- 194,199 ----
doc = self.GetDocument()
! # Enable Unicode
! self.SendScintilla(scintillacon.SCI_SETCODEPAGE, scintillacon.SC_CP_UTF8, 0)
# Create margins
self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 1, scintillacon.SC_MARGIN_SYMBOL);
***************
*** 389,396 ****
doc = self.GetDocument()
s = self.GetTextRange()
! if is_platform_unicode:
! s = unicode(s,"utf-8").encode("mbcs")
f = open(filename, 'wb')
! f.write(s)
f.close()
doc.SetModifiedFlag(0)
--- 388,395 ----
doc = self.GetDocument()
s = self.GetTextRange()
! # Save in binary mode so line endings are not translated.
! # Edit control uses '\r\n', and universal newlines mode replaces ALL '\r' with '\r\n'.
f = open(filename, 'wb')
! f.write(s.encode('mbcs'))
f.close()
doc.SetModifiedFlag(0)
***************
*** 439,453 ****
funDesc = typeInfo.GetFuncDesc(iFun)
funName = typeInfo.GetNames(funDesc.memid)[0]
! if not items_dict.has_key(funName):
items_dict[funName] = None
except:
pass
except:
! win32ui.SetStatusText("Error attempting to get object attributes - %s" % (`sys.exc_info()[0]`,))
! # ensure all keys are strings.
! items = map(str, items_dict.keys())
# All names that start with "_" go!
! items = filter(lambda word: word[0]!='_', items)
if not items:
--- 438,452 ----
funDesc = typeInfo.GetFuncDesc(iFun)
funName = typeInfo.GetNames(funDesc.memid)[0]
! if funName not in items_dict:
items_dict[funName] = None
except:
pass
except:
! win32ui.SetStatusText("Error attempting to get object attributes - %s" % (repr(sys.exc_info()[0]),))
! # ensure all keys are strings.
! items = [str(k) for k in items_dict.keys()]
# All names that start with "_" go!
! items = [k for k in items if not k.startswith('_')]
if not items:
***************
*** 466,477 ****
text = self.GetTextRange(self.LineIndex(minline),endpos)
try:
! list = re.findall(r"\b"+left+"\.\w+",text)
except re.error:
# parens etc may make an invalid RE, but this code wouldnt
# benefit even if the RE did work :-)
! list = []
prefix = len(left)+1
unique = {}
! for li in list:
unique[li[prefix:]] = 1
# Assuming traditional usage of self...
--- 465,476 ----
text = self.GetTextRange(self.LineIndex(minline),endpos)
try:
! l = re.findall(r"\b"+left+"\.\w+",text)
except re.error:
# parens etc may make an invalid RE, but this code wouldnt
# benefit even if the RE did work :-)
! l = []
prefix = len(left)+1
unique = {}
! for li in l:
unique[li[prefix:]] = 1
# Assuming traditional usage of self...
***************
*** 479,483 ****
self._UpdateWithClassMethods(unique,curclass)
! items = filter(lambda word: word[:2]!='__' or word[-2:]!='__', unique.keys())
# Ignore the word currently to the right of the dot - probably a red-herring.
try:
--- 478,482 ----
self._UpdateWithClassMethods(unique,curclass)
! items = [word for word in unique.keys() if word[:2]!='__' or word[-2:]!='__']
# Ignore the word currently to the right of the dot - probably a red-herring.
try:
***************
*** 530,534 ****
curclass = None
# Find out which class we are in
! for item in clbrdata.values():
if item.module==curmodule:
item_lineno = item.lineno - 1 # Scintilla counts lines from 0, whereas pyclbr - from 1
--- 529,533 ----
curclass = None
# Find out which class we are in
! for item in clbrdata.itervalues():
if item.module==curmodule:
item_lineno = item.lineno - 1 # Scintilla counts lines from 0, whereas pyclbr - from 1
Index: bindings.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/bindings.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** bindings.py 9 Aug 2008 16:47:07 -0000 1.5
--- bindings.py 14 Nov 2008 00:22:25 -0000 1.6
***************
*** 6,9 ****
--- 6,10 ----
import keycodes
import sys
+ import traceback
HANDLER_ARGS_GUESS=0
***************
*** 50,54 ****
def complete_configure(self):
! for id in command_to_events.keys():
self.parent_view.HookCommand(self._OnCommand, id)
--- 51,55 ----
def complete_configure(self):
! for id in command_to_events.iterkeys():
self.parent_view.HookCommand(self._OnCommand, id)
***************
*** 81,85 ****
if id is None:
# See if we even have an event of that name!?
! if not self.bindings.has_key(event):
return None
id = self.bind_command(event)
--- 82,86 ----
if id is None:
# See if we even have an event of that name!?
! if event not in self.bindings:
return None
id = self.bind_command(event)
***************
*** 139,143 ****
else:
args = (event_param,)
! rc = apply(binding.handler, args)
if handler_args_type==HANDLER_ARGS_IDLE:
# Convert to our return code.
--- 140,144 ----
else:
args = (event_param,)
! rc = binding.handler(*args)
if handler_args_type==HANDLER_ARGS_IDLE:
# Convert to our return code.
***************
*** 147,151 ****
rc = 1
except:
! import traceback
message = "Firing event '%s' failed." % event
print message
--- 148,155 ----
rc = 1
except:
! # ??? - hrm - py3k might want:
! # traceback.print_exc(chain=False)
! # but why? We do a normal print_exc() below (and py2k
! # doesn't have that param.
message = "Firing event '%s' failed." % event
print message
Index: IDLEenvironment.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/IDLEenvironment.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** IDLEenvironment.py 9 Aug 2008 16:47:07 -0000 1.11
--- IDLEenvironment.py 14 Nov 2008 00:22:25 -0000 1.12
***************
*** 9,12 ****
--- 9,13 ----
from pywin.mfc.dialog import GetSimpleInput
+ from pywin import default_scintilla_encoding
wordchars = string.ascii_uppercase + string.ascii_lowercase + string.digits
***************
*** 15,18 ****
--- 16,20 ----
pass
+
class EmptyRange(Exception): # Internally raised.
pass
***************
*** 42,46 ****
if self.finished:
return ""
! if not self.__dict__.has_key("_scint_lines"):
# XXX - note - assumes this is only called once the file is loaded!
self._scint_lines = self.text.edit.GetTextRange().split("\n")
--- 44,48 ----
if self.finished:
return ""
! if "_scint_lines" not in self.__dict__:
# XXX - note - assumes this is only called once the file is loaded!
self._scint_lines = self.text.edit.GetTextRange().split("\n")
***************
*** 49,53 ****
if i >= len(sl):
return ""
! return sl[i]+"\n"
try:
--- 51,55 ----
if i >= len(sl):
return ""
! return (sl[i]+"\n").encode(default_scintilla_encoding)
try:
***************
*** 69,73 ****
self.extension_menus = None
try:
! for ext in self.extensions.values():
closer = getattr(ext, "close", None)
if closer is not None:
--- 71,75 ----
self.extension_menus = None
try:
! for ext in self.extensions.itervalues():
closer = getattr(ext, "close", None)
if closer is not None:
***************
*** 84,88 ****
ext = self.extensions[extension] = klass(self)
# Find and bind all the events defined in the extension.
! events = filter(lambda item: item[-6:]=="_event", dir(klass))
for event in events:
name = "<<%s>>" % (event[:-6].replace("_", "-"), )
--- 86,90 ----
ext = self.extensions[extension] = klass(self)
# Find and bind all the events defined in the extension.
! events = [item for item in dir(klass) if item[-6:]=="_event"]
for event in events:
name = "<<%s>>" % (event[:-6].replace("_", "-"), )
***************
*** 94,102 ****
bindings = self.edit.bindings
ret = []
! for ext in self.extensions.values():
menudefs = getattr(ext, "menudefs", [])
for name, items in menudefs:
if name == menu_name:
! for text, event in filter(lambda item: item is not None, items):
text = text.replace("&", "&&")
text = text.replace("_", "&")
--- 96,104 ----
bindings = self.edit.bindings
ret = []
! for ext in self.extensions.itervalues():
menudefs = getattr(ext, "menudefs", [])
for name, items in menudefs:
if name == menu_name:
! for text, event in [item for item in items if item is not None]:
text = text.replace("&", "&&")
text = text.replace("_", "&")
***************
*** 202,206 ****
def TkIndexToOffset(bm, edit, marks):
base, nextTokPos = _NextTok(bm, 0)
! if base is None: raise ValueError, "Empty bookmark ID!"
if base.find(".")>0:
try:
--- 204,208 ----
def TkIndexToOffset(bm, edit, marks):
base, nextTokPos = _NextTok(bm, 0)
! if base is None: raise ValueError("Empty bookmark ID!")
if base.find(".")>0:
try:
***************
*** 208,212 ****
if col=="first" or col=="last":
# Tag name
! if line != "sel": raise ValueError, "Tags arent here!"
sel = edit.GetSel()
if sel[0]==sel[1]:
--- 210,214 ----
if col=="first" or col=="last":
# Tag name
! if line != "sel": raise ValueError("Tags arent here!")
sel = edit.GetSel()
if sel[0]==sel[1]:
***************
*** 226,230 ****
pos = pos + int(col)
except (ValueError, IndexError):
! raise ValueError, "Unexpected literal in '%s'" % base
elif base == 'insert':
pos = edit.GetSel()[0]
--- 228,232 ----
pos = pos + int(col)
except (ValueError, IndexError):
! raise ValueError("Unexpected literal in '%s'" % base)
elif base == 'insert':
pos = edit.GetSel()[0]
***************
*** 238,242 ****
pos = marks[base]
except KeyError:
! raise ValueError, "Unsupported base offset or undefined mark '%s'" % base
while 1:
--- 240,244 ----
pos = marks[base]
except KeyError:
! raise ValueError("Unsupported base offset or undefined mark '%s'" % base)
while 1:
***************
*** 245,252 ****
if word in ['+','-']:
num, nextTokPos = _NextTok(bm, nextTokPos)
! if num is None: raise ValueError, "+/- operator needs 2 args"
what, nextTokPos = _NextTok(bm, nextTokPos)
! if what is None: raise ValueError, "+/- operator needs 2 args"
! if what[0] <> "c": raise ValueError, "+/- only supports chars"
if word=='+':
pos = pos + int(num)
--- 247,254 ----
if word in ['+','-']:
num, nextTokPos = _NextTok(bm, nextTokPos)
! if num is None: raise ValueError("+/- operator needs 2 args")
what, nextTokPos = _NextTok(bm, nextTokPos)
! if what is None: raise ValueError("+/- operator needs 2 args")
! if what[0] != "c": raise ValueError("+/- only supports chars")
if word=='+':
pos = pos + int(num)
***************
*** 268,272 ****
pos = pos + 1
else:
! raise ValueError, "Unsupported relative offset '%s'" % word
return max(pos, 0) # Tkinter is tollerant of -ve indexes - we aren't
--- 270,274 ----
pos = pos + 1
else:
! raise ValueError("Unsupported relative offset '%s'" % word)
return max(pos, 0) # Tkinter is tollerant of -ve indexes - we aren't
***************
*** 349,355 ****
pos = self._getoffset(pos)
except EmptyRange:
! raise TextError, "Empty range"
self.edit.SetSel((pos, pos))
# IDLE only deals with "\n" - we will be nicer
bits = text.split('\n')
self.edit.SCIAddText(bits[0])
--- 351,358 ----
pos = self._getoffset(pos)
except EmptyRange:
! raise TextError("Empty range")
self.edit.SetSel((pos, pos))
# IDLE only deals with "\n" - we will be nicer
+
bits = text.split('\n')
self.edit.SCIAddText(bits[0])
***************
*** 363,367 ****
if end is not None: end = self._getoffset(end)
except EmptyRange:
! raise TextError, "Empty range"
# If end is specified and == start, then we must delete nothing.
if start==end: return
--- 366,370 ----
if end is not None: end = self._getoffset(end)
except EmptyRange:
! raise TextError("Empty range")
# If end is specified and == start, then we must delete nothing.
if start==end: return
***************
*** 396,400 ****
pos = self._getoffset(pos)
except EmptyRange:
! raise TextError, "Empty range '%s'" % pos
if name == "insert":
self.edit.SetSel( pos )
--- 399,403 ----
pos = self._getoffset(pos)
except EmptyRange:
! raise TextError("Empty range '%s'" % pos)
if name == "insert":
self.edit.SetSel( pos )
***************
*** 403,417 ****
def tag_add(self, name, start, end):
! if name != "sel": raise ValueError, "Only sel tag is supported"
try:
start = self._getoffset(start)
end = self._getoffset(end)
except EmptyRange:
! raise TextError, "Empty range"
self.edit.SetSel( start, end )
def tag_remove(self, name, start, end):
if name !="sel" or start != "1.0" or end != "end":
! raise ValueError, "Cant remove this tag"
# Turn the sel into a cursor
self.edit.SetSel(self.edit.GetSel()[0])
--- 406,420 ----
def tag_add(self, name, start, end):
! if name != "sel": raise ValueError("Only sel tag is supported")
try:
start = self._getoffset(start)
end = self._getoffset(end)
except EmptyRange:
! raise TextError("Empty range")
self.edit.SetSel( start, end )
def tag_remove(self, name, start, end):
if name !="sel" or start != "1.0" or end != "end":
! raise ValueError("Cant remove this tag")
# Turn the sel into a cursor
self.edit.SetSel(self.edit.GetSel()[0])
|