JulianEberius / SublimeRope

ST2 only, use SublimePythonIDE with ST3: Adds Python completions and some IDE-like functions to Sublime Text 2, through the use of the Rope library
GNU General Public License v2.0
250 stars 26 forks source link

Fix manual invocation #79

Closed Caanon closed 11 years ago

Caanon commented 11 years ago

Looks like a "not" was missing from on_query_completion.

To reproduce the bug this fixes: 1) Set keybinding: {"keys": ["ctrl+shift+space"], "command": "python_manual_completion_request"} 2) Set option "complete_as_you_type" to false 3) Create new python file and type:

import os os.[[ctrl+shift+space]] <--- and rope is not invoked

This is because SublimeRopeListener.user_requested was set to True, and will never pass the first "if" test in on_query_completions, and as far as I can tell no other function will set user_requested to False. Now that I think about it, it seems calling PythonManualCompletionRequest actually completely breaks autocompletion permanently until a) the plugin is reloaded or b) ST2 is restarted. So this fixes that too I guess? :)

JulianEberius commented 11 years ago

Thanks for reporting the bug... I did a different fix though, one that is imho more python (i.e., readable) than the original three-line condition.

Julian

Caanon commented 11 years ago

Thanks for the quick fix, cheers!