diff options
author | Ian Thompson <quornian@googlemail.com> | 2008-07-21 04:38:42 +0400 |
---|---|---|
committer | Ian Thompson <quornian@googlemail.com> | 2008-07-21 04:38:42 +0400 |
commit | 6352cd509e6e6f834684ec1e24c42e274a2ed31b (patch) | |
tree | b6c0857db136f08ee149feb66f0136249aa05a3b /release/scripts/textplugin_suggest.py | |
parent | f042a468fdd0f06ca41c022c9ed6ac59d35ff143 (diff) |
BPyTextPlugin now has descriptors for variables, functions and classes (and their variables/functions). Each descriptor also holds the line number of the definition allowing a simple outliner to be written.
Text.setCursorPos(row, col) now pops the text into view if it is in the active window space. The outliner uses this to jump to any definition in a script; it is invoked with Ctrl+T.
Diffstat (limited to 'release/scripts/textplugin_suggest.py')
-rw-r--r-- | release/scripts/textplugin_suggest.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/release/scripts/textplugin_suggest.py b/release/scripts/textplugin_suggest.py index 20e248017af..f39e2db1f7f 100644 --- a/release/scripts/textplugin_suggest.py +++ b/release/scripts/textplugin_suggest.py @@ -25,9 +25,9 @@ def check_membersuggest(line, c): return True def check_imports(line, c): - if line.rfind('import ', 0, c) == c-7: + if c >= 7 and line.rfind('import ', 0, c) == c-7: return True - if line.rfind('from ', 0, c) == c-5: + if c >= 5 and line.rfind('from ', 0, c) == c-5: return True return False @@ -39,7 +39,7 @@ def main(): (line, c) = current_line(txt) # Check we are in a normal context - if get_context(txt) != NORMAL: + if get_context(txt) != CTX_NORMAL: return # Check the character preceding the cursor and execute the corresponding script |