diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-22 20:23:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-22 20:23:46 +0400 |
commit | d86864027d449114868ec531b9ccf6dd19dbe67f (patch) | |
tree | cccdba556255c55703f1324d8c11fcd6b657ff02 /release/ui | |
parent | 87f5f194bcf8a4bb8a22b8402d8bb088084d6489 (diff) |
PyConsole improvements
- Commands from the history wont get modified in-place when you cycle back and re-use them.
- Ctrl Left/Right skip words.
- Autocompletion on a variable that has no alternatives adds a '.'
'bpy' -> 'bpy.', generally more useful since autocomp again will give the members of bpy
also moved text_check_* functions into BKE_text.h for the console to access.
Diffstat (limited to 'release/ui')
-rw-r--r-- | release/ui/space_console.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/release/ui/space_console.py b/release/ui/space_console.py index 980c11b706a..4641d7900cb 100644 --- a/release/ui/space_console.py +++ b/release/ui/space_console.py @@ -246,11 +246,17 @@ def autocomp(bcon): break else: autocomp_prefix_ret += char_soup.pop() - - print(autocomp_prefix_ret) + return autocomp_prefix_ret, autocomp_members elif len(autocomp_members) == 1: - return autocomp_members[0][len(autocomp_prefix):], [] + if autocomp_prefix == autocomp_members[0]: + # the variable matched the prefix exactly + # add a '.' so you can quickly continue. + # Could try add [] or other possible extensions rather then '.' too if we had the variable. + return '.', [] + else: + # finish off the of the word word + return autocomp_members[0][len(autocomp_prefix):], [] else: return '', [] |