[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37412] trunk/blender/release/scripts/ modules/console/intellisense.py: improved autocompleation when there is a common prefix
Campbell Barton
ideasman42 at gmail.com
Sat Jun 11 19:03:26 CEST 2011
Revision: 37412
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37412
Author: campbellbarton
Date: 2011-06-11 17:03:26 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
improved autocompleation when there is a common prefix
Modified Paths:
--------------
trunk/blender/release/scripts/modules/console/intellisense.py
Modified: trunk/blender/release/scripts/modules/console/intellisense.py
===================================================================
--- trunk/blender/release/scripts/modules/console/intellisense.py 2011-06-11 15:37:16 UTC (rev 37411)
+++ trunk/blender/release/scripts/modules/console/intellisense.py 2011-06-11 17:03:26 UTC (rev 37412)
@@ -120,22 +120,25 @@
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)
More information about the Bf-blender-cvs
mailing list