"Intellisense" drop-down...

olivierS.dagenaisP at canadaA.comM.bbs olivierS.dagenaisP at canadaA.comM.bbs
Sun Jul 16 19:50:02 EDT 2000


I found it!  In coloreditor.py, I found the two methods I had been wanting
to use, namely SciAutoCActive and SCIAutoCComplete!

Here it is, folks, the ability to use another key than TAB to select a word
in the AutoComplete list:


def AutoCompleteOrIgnore ( editor_window, event ):
    editor = editor_window.edit

    if editor.SCIAutoCActive ( ):
        editor.SCIAutoCComplete ( )

    return 1



Just add it to your .cfg file and then, in the [Keys] section, add/change
the following:

Ctrl+Space        = <<expand-word>>
Ctrl+Enter        = AutoCompleteOrIgnore
Space             = AutoCompleteOrIgnore

and PythonWin should now [sort of] behave like VB!  If you don't like "it"
adding a space after an "auto-completed" word, change the function to:


def AutoCompleteOrIgnore ( editor_window, event ):
    editor = editor_window.edit

    if editor.SCIAutoCActive ( ):
        editor.SCIAutoCComplete ( )
        return 0

    return 1


Wohoo!!!

--
----------------------------------------------------------------------
Olivier A. Dagenais - Carleton University - Computer Science III


"Neil Hodgson" <neilh at scintilla.org> wrote in message
news:osrc5.3577$4p3.27127 at news-server.bigpond.net.au...
> > I have found no way of defining new key combinations to select the
> currently
> > highlighted word in the "Intellisense" drop-down list.  For example:
> > ...
> > I hightlight "Apply" and the only key I can use to make "Apply" appear
and
> > the list to disappear is "Tab".  I want other keys to trigger this.  The
> > default.cfg file only lists this:
>
>    When the previous post appeared about Ctrl+Enter in auto-completion, I
> had a look at extending the keys that would choose an item and tried
> changing this in Scintilla. This worked in other applications but not in
> PythonWin as PythonWin intercepts keys before sending them on to
Scintilla.
> Then I went looking through PythonWin but the code was confusing so I gave
> up.
>
>     If you are interested in working on this, the Enter key calls
> newline_and_indent_event in pywin\idle\AutoIndent.py. So you could
intercept
> it here or else bind Enter to your own event that calls the current
> newline_and_indent_event only when no autocompletion is shown.
>
>    Neil
>
>
>



More information about the Python-list mailing list