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-03-14 09:48:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-14 09:48:51 +0300
commitb0a9dbf9c80a7018d0bf58ac4544fd3bed6f7b86 (patch)
treeac18386fc4566d7957ff83ca7ddae34fbe42ee7b /release/scripts
parent4a747bebf456f57f5011fb3ee467c5a486ddf7a1 (diff)
auto-complete was moving the selection.
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/op/console_python.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py
index 84b2ed24350..4a2eb833d83 100644
--- a/release/scripts/op/console_python.py
+++ b/release/scripts/op/console_python.py
@@ -240,12 +240,20 @@ def autocomplete(context):
# This function isnt aware of the text editor or being an operator
# just does the autocomp then copy its results back
- current_line.body, current_line.current_character, scrollback = \
- intellisense.expand(
- line=current_line.body,
+ result = intellisense.expand(
+ line=line,
cursor=current_line.current_character,
namespace=console.locals,
private=bpy.app.debug)
+
+ line_new = result[0]
+ current_line.body, current_line.current_character, scrollback = result
+ del result
+
+ # update sel. setting body should really do this!
+ ofs = len(line_new) - len(line)
+ sc.select_start += ofs
+ sc.select_end += ofs
except:
# unlikely, but this can happen with unicode errors for example.
# or if the api attribute access its self causes an error.