[Python-checkins] CVS: python/dist/src/Tools/idle ParenMatch.py,1.2,1.3

Guido van Rossum guido@cnri.reston.va.us
Mon, 6 Mar 2000 09:16:44 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Tools/idle
In directory eric:/projects/python/develop/guido/src/Tools/idle

Modified Files:
	ParenMatch.py 
Log Message:
Don't use 1.6-isms (s.startswith()) -- we want to distribute this
before 1.6 is out so it has to be compatible with 1.5.2.


Index: ParenMatch.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Tools/idle/ParenMatch.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ParenMatch.py	2000/03/03 23:06:44	1.2
--- ParenMatch.py	2000/03/06 14:16:41	1.3
***************
*** 178,185 ****
  	   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)
--- 178,185 ----
  	   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)