[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14656] trunk/blender/release/scripts/ console.py: used fixed width font, set the command history to ignore dupes when pressing up/down

Campbell Barton ideasman42 at gmail.com
Fri May 2 12:33:33 CEST 2008


Revision: 14656
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14656
Author:   campbellbarton
Date:     2008-05-02 12:33:32 +0200 (Fri, 02 May 2008)

Log Message:
-----------
used fixed width font, set the command history to ignore dupes when pressing up/down

Modified Paths:
--------------
    trunk/blender/release/scripts/console.py

Modified: trunk/blender/release/scripts/console.py
===================================================================
--- trunk/blender/release/scripts/console.py	2008-05-02 10:22:44 UTC (rev 14655)
+++ trunk/blender/release/scripts/console.py	2008-05-02 10:33:32 UTC (rev 14656)
@@ -61,7 +61,7 @@
 
 global __FONT_SIZE__
 
-__FONT_SIZES__ = ( ('tiny', 10), ('small', 12), ('normal', 14), ('large', 16) )
+__FONT_SIZES__ = ( ('tiny', 10), ('small', 12), ('normalfix', 14), ('large', 16) )
 __FONT_SIZE__ = 2 # index for the list above, normal default.
 
 global __CONSOLE_LINE_OFFSET__
@@ -420,9 +420,13 @@
 		global histIndex, cmdBuffer
 		if abs(histIndex)+1 >= len(cmdBuffer):
 			histIndex = -1
+		histIndex_orig = histIndex
 		histIndex -= 1
-		while cmdBuffer[histIndex].type != 0 and abs(histIndex) < len(cmdBuffer):
+		
+		while	(cmdBuffer[histIndex].type != 0 and abs(histIndex) < len(cmdBuffer)) or \
+				( cmdBuffer[histIndex].cmd == cmdBuffer[histIndex_orig].cmd):
 			histIndex -= 1
+			
 		if cmdBuffer[histIndex].type == 0: # we found one
 			cmdBuffer[-1].cmd = cmdBuffer[histIndex].cmd			
 	
@@ -430,9 +434,13 @@
 		global histIndex, cmdBuffer
 		if histIndex >= -2:
 			histIndex = -len(cmdBuffer)
+		histIndex_orig = histIndex
 		histIndex += 1
-		while cmdBuffer[histIndex].type != 0 and histIndex != -2:
+		while	(cmdBuffer[histIndex].type != 0 and histIndex != -2) or \
+				( cmdBuffer[histIndex].cmd == cmdBuffer[histIndex_orig].cmd):
+			
 			histIndex += 1
+			
 		if cmdBuffer[histIndex].type == 0: # we found one
 			cmdBuffer[-1].cmd = cmdBuffer[histIndex].cmd
 	





More information about the Bf-blender-cvs mailing list