[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37940] trunk/blender/release/scripts/ modules/console/intellisense.py: bug [#27779] Python console completion broken

Campbell Barton ideasman42 at gmail.com
Wed Jun 29 08:06:59 CEST 2011


Revision: 37940
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37940
Author:   campbellbarton
Date:     2011-06-29 06:06:59 +0000 (Wed, 29 Jun 2011)
Log Message:
-----------
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.

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-29 05:29:35 UTC (rev 37939)
+++ trunk/blender/release/scripts/modules/console/intellisense.py	2011-06-29 06:06:59 UTC (rev 37940)
@@ -130,11 +130,15 @@
         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




More information about the Bf-blender-cvs mailing list