Dear Developers,

It would be nice to be able to use the tab key for calling code
completion in the code editor.
Pressing tab to call code completion and tab also to choose from list
reduces keyboard work.

Now (2.0.12) it is impossible to set up this configuration via
keyboard shortcuts.

One could ask, what if the programmer presses tab in order to indent
and not to complete code?
Answer: when tab is pressed and only white spaces are previous to the
cursor, an indentation should be made instead of code completion. If
any not white space character stands previous to the cursor, code
completion should be called.

The following code does the trick:

$ diff codeeditor.py /d/Python/python-2.7/Lib/site-packages/spyderlib/
widgets/sourcecode/codeeditor.py
1662c1662,1667
<             self.indent_or_replace()
---
>             # self.indent_or_replace()
>             line = unicode(self.textCursor().block().text())
>             if not line[:self.textCursor().positionInBlock()].strip():
>                 self.indent_or_replace()
>             else:
>                 self.emit(SIGNAL('trigger_code_completion(bool)'), True)

Regards,
Roland

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/spyderlib?hl=en.

Reply via email to