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>2011-06-29 10:06:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-29 10:06:59 +0400
commitc19d2d2da208f7fb30c59343cb744ac72f223a8e (patch)
tree1af2cf7ad2f5a23959522b9bfa43f6452dd892c3 /release/scripts/modules/console/intellisense.py
parent40a15a04be4895f0ec2b7f3be7932963907df67d (diff)
bug [#27779] Python console completion broken
modified auto-completion, though this may need to become a preference. The problem is: - including _all_ text as a prefix can take a lot of space, and isnt too readable. - including only the previous word is error prone because detecting delimiters can fail when editing strings. so I've set it to only include the last part of the string but align to the cursor to make it more readable.
Diffstat (limited to 'release/scripts/modules/console/intellisense.py')
-rw-r--r--release/scripts/modules/console/intellisense.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/release/scripts/modules/console/intellisense.py b/release/scripts/modules/console/intellisense.py
index 072d467ff86..b6de0c6c6de 100644
--- a/release/scripts/modules/console/intellisense.py
+++ b/release/scripts/modules/console/intellisense.py
@@ -130,11 +130,15 @@ def expand(line, cursor, namespace, private=True):
else:
# causes blender bug [#27495] since string keys may contain '.'
# scrollback = ' '.join([m.split('.')[-1] for m in matches])
+
+ # add white space to align with the cursor
+ white_space = " " + (" " * (cursor + len(prefix)))
word_prefix = word + prefix
- scrollback = ' '.join(
- [m[len(word_prefix):]
+ scrollback = '\n'.join(
+ [white_space + m[len(word_prefix):]
if (word_prefix and m.startswith(word_prefix))
- else m.split('.')[-1]
+ else
+ white_space + m.split('.')[-1]
for m in matches])
no_calltip = True