[Idle-dev] CVS: idle ParenMatch.py,1.5,1.6
Kurt B. Kaiser
kbk@users.sourceforge.net
Mon, 16 Sep 2002 20:43:40 -0700
Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv14236
Modified Files:
ParenMatch.py
Log Message:
Merge Py Idle changes:
Rev 1.6 doerwalter
(string methods)
Index: ParenMatch.py
===================================================================
RCS file: /cvsroot/idlefork/idle/ParenMatch.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** ParenMatch.py 14 Sep 2002 02:46:19 -0000 1.5
--- ParenMatch.py 17 Sep 2002 03:43:38 -0000 1.6
***************
*** 11,16 ****
"""
- import string
-
import PyParse
from AutoIndent import AutoIndent, index2line
--- 11,14 ----
***************
*** 167,174 ****
or keysym_type(buf[i]) != right_keysym_type:
return None
! lines_back = string.count(buf[i:], "\n") - 1
# subtract one for the "\n" added to please the parser
upto_open = buf[:i]
! j = string.rfind(upto_open, "\n") + 1 # offset of column 0 of line
offset = i - j
return "%d.%d" % (lno - lines_back, offset)
--- 165,172 ----
or keysym_type(buf[i]) != right_keysym_type:
return None
! lines_back = buf[i:].count("\n") - 1
# subtract one for the "\n" added to please the parser
upto_open = buf[:i]
! j = upto_open.rfind("\n") + 1 # offset of column 0 of line
offset = i - j
return "%d.%d" % (lno - lines_back, offset)