<type>documentation</type>
<domain>edit</domain>
<id>turbo-completion</id>
<title>Turbo Completion Mode for Python</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>pro+</product>

In Wing Pro, when the `Editor > Auto-completion > Python Turbo Mode
<script:show_preferences_gui#prefname="edit.autocomplete-turbo-mode">`__ preference is
enabled, Wing uses a different completion mode for Python files, and in the `Python Shell
<ref:debug/python-shell>`__ and `Debug Console
<ref:debug/debug-console>`__. This mode treats any key that could not be part of
a symbol name as a completion key, in a context-appropriate way.

This allows typing until the correct symbol is selected in the completer and then 
immediately moving on to typing the code that should follow that symbol. For example, typing
``+`` will place the completion, enter ``+`` into the editor, apply any relevant
`auto-editing <ref:edit/auto-editing>`__ operations (such as auto-spacing), and show 
the completer again if appropriate.

In contexts where a new symbol is being defined, Wing disables Turbo mode
depending on the character being pressed.  For example, pressing ``=`` after
a name at the start of a line, entering an argument name in a def, and
entering a symbol after ``for`` all define a new symbol in most cases.
In these contexts, ``Tab`` must be pressed to cause completion to occur.

Although this mode offers a much more efficient way to type Python code, it takes
some getting used to before unwanted completions can be avoided.  Specifically:

(1) If you are trying to type a symbol name before it has been defined, Wing may
    choose a similarly named symbol from the completer if you do not first
    cancel out of the completer.  As a result, it's usually easier to define
    symbols first, before writing other code that uses them.
    
(2) Similarly, Wing may fail to recognize some contexts as defining a new symbol.
    To avoid completing a similarly named symbol, you must first cancel out of 
    the completer.
    
To make canceling from the completer easier in these cases, ``Ctrl``, ``Alt``, and
``Command`` pressed alone are also treated as cancel keys, in addition to ``Esc``.

For the same reason, snippets and auto-imports do not participate in Turbo mode
completion. To enter those from the auto-completer, press ``Tab``.
