<type>documentation</type>
<domain>intro</domain>
<id>tutorial-turbo-completion</id>
<title>Tutorial: Turbo Completion Mode</title>
<date>$Date: 2013-06-27 19:22:37 -0400 (Thu, 27 Jun 2013) $</date>
<product>pro+</product>

Auto-completion normally requires pressing a completion key, as configured in
the `Editor > Auto-completion > Completion Keys
<script:show_preferences_gui#prefname="edit.autocomplete-keys">`__ preference,
before a completion is entered into the editor.

Wing also provides a ``Python Turbo Mode`` for auto-completion where where completion
occurs on any key that cannot be part of a symbol. It takes some effort to learn to use
this feature, but it can greatly reduce typing once you get used to it.

Try it now by enabling the `Editor > Auto-completion > Python Turbo Mode
<script:show_preferences_gui#prefname="edit.autocomplete-turbo-mode">`__ preference. Then
go to the bottom of ``example1.py`` and press the following keys in order: ``R e ( G e t
(``. You will see the following code in the editor produced by these seven key strokes:

.. python::

  ReadPythonNews(GetItemCount())
  
Depending on your Python version you may not need as many keystrokes before
``GetItemCount`` is selected in the completer. As soon as it is, the final ``(`` may be
pressed.

Turbo completion mode distinguishes between contexts where a new symbol may be defined and
those where an existing symbol must be used. For example, try typing the following
keystrokes on a new line: ``c``, ``=``. Wing knows that the ``=`` indicates you may be
defining a new symbol so it does not place the current selection from the auto-completer.
If you did want completion to occur in a defining context, you would still have to press
``Tab`` or another completion key.

In a context where you are trying to type something other than what is in the completer,
pressing ``Ctrl``, ``Alt`` or ``Command`` briefly by itself will hide the auto-completer
and thus disable turbo-completion until you type more symbol characters and the completer
is shown again.
