diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-11 21:03:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-11 21:03:26 +0400 |
commit | 90d8fcb5220225d8ac3d09a126829fffed07c719 (patch) | |
tree | 3db16b50610d40c5593702549e0b0dd72ce4a4bf /release/scripts/modules/console | |
parent | 3d7dc49e3e38933000e1c18832dde899cec28344 (diff) |
improved autocompleation when there is a common prefix
Diffstat (limited to 'release/scripts/modules/console')
-rw-r--r-- | release/scripts/modules/console/intellisense.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/modules/console/intellisense.py b/release/scripts/modules/console/intellisense.py index 00f7dbd3657..072d467ff86 100644 --- a/release/scripts/modules/console/intellisense.py +++ b/release/scripts/modules/console/intellisense.py @@ -120,22 +120,25 @@ def expand(line, cursor, namespace, private=True): from . import complete_calltip matches, word, scrollback = complete_calltip.complete(line, cursor, namespace) + prefix = os.path.commonprefix(matches)[len(word):] no_calltip = False else: matches, word = complete(line, cursor, namespace, private) + prefix = os.path.commonprefix(matches)[len(word):] if len(matches) == 1: scrollback = '' else: # causes blender bug [#27495] since string keys may contain '.' # scrollback = ' '.join([m.split('.')[-1] for m in matches]) + word_prefix = word + prefix scrollback = ' '.join( - [m[len(word):] - if (word and m.startswith(word)) + [m[len(word_prefix):] + if (word_prefix and m.startswith(word_prefix)) else m.split('.')[-1] for m in matches]) no_calltip = True - prefix = os.path.commonprefix(matches)[len(word):] + if prefix: line = line[:cursor] + prefix + line[cursor:] cursor += len(prefix) |