[Python-checkins] CVS: python/dist/src/Tools/idle AutoIndent.py,1.17,1.18 EditorWindow.py,1.38,1.39
Guido van Rossum
gvanrossum@users.sourceforge.net
Wed, 23 Jan 2002 07:15:15 -0800
Update of /cvsroot/python/python/dist/src/Tools/idle
In directory usw-pr-cvs1:/tmp/cvs-serv16713
Modified Files:
AutoIndent.py EditorWindow.py
Log Message:
Properly fix SF bug #507298 (Gregor Lingl): shellpython2.2 -Qnew smart
indent error
Use // where int division is intended. (This breaks IDLE for use with
previous Python versions -- I don't care.)
Index: AutoIndent.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/idle/AutoIndent.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** AutoIndent.py 2002/01/23 05:02:20 1.17
--- AutoIndent.py 2002/01/23 15:15:13 1.18
***************
*** 172,176 ****
have = len(expand(chars, tabwidth))
assert have > 0
! want = int((have - 1) / self.indentwidth) * self.indentwidth
ncharsdeleted = 0
while 1:
--- 172,176 ----
have = len(expand(chars, tabwidth))
assert have > 0
! want = int((have - 1) // self.indentwidth) * self.indentwidth
ncharsdeleted = 0
while 1:
***************
*** 496,500 ****
elif ch == '\t':
raw = raw + 1
! effective = (int(effective / tabwidth) + 1) * tabwidth
else:
break
--- 496,500 ----
elif ch == '\t':
raw = raw + 1
! effective = (effective // tabwidth + 1) * tabwidth
else:
break
Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/idle/EditorWindow.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** EditorWindow.py 2001/04/18 18:42:48 1.38
--- EditorWindow.py 2002/01/23 15:15:13 1.39
***************
*** 466,470 ****
lineno = self.getlineno(mark)
height = bot - top
! newtop = max(1, lineno - height/2)
text.yview(float(newtop))
--- 466,470 ----
lineno = self.getlineno(mark)
height = bot - top
! newtop = max(1, lineno - height//2)
text.yview(float(newtop))