Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-05-02 14:33:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-05-02 14:33:32 +0400
commitda509d33c72a5c23327feafa035b1e9ec349f297 (patch)
tree03882b9665e0e1d64e9bcec1bde9f8b84fc667c5 /release
parent71284880d3b6f1689a3b341ee1565d7ae88f76dd (diff)
used fixed width font, set the command history to ignore dupes when pressing up/down
Diffstat (limited to 'release')
-rw-r--r--release/scripts/console.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/release/scripts/console.py b/release/scripts/console.py
index 6860af4442e..9a18c724d47 100644
--- a/release/scripts/console.py
+++ b/release/scripts/console.py
@@ -61,7 +61,7 @@ __LINE_HISTORY__ = 500
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 @@ def handle_event(evt, val):
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 @@ def handle_event(evt, val):
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