mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Corrected some bugs in AutoComplete. Also, Page Up/Down in ACW implemented;
mouse and cursor selection in ACWindow implemented; double Tab inserts current selection and closes ACW (similar to double-click and Return); scroll wheel now works in ACW. Added AutoComplete instructions to IDLE Help.
This commit is contained in:
parent
4c11a92625
commit
209de1f6ca
3 changed files with 103 additions and 21 deletions
|
@ -44,6 +44,10 @@ Edit Menu:
|
|||
Find in Files... -- Open a search dialog box for searching files
|
||||
Replace... -- Open a search-and-replace dialog box
|
||||
Go to Line -- Ask for a line number and show that line
|
||||
Show Calltip -- Open a small window with function param hints
|
||||
Show Completions -- Open a scroll window allowing selection keywords
|
||||
and attributes. (see '*TIPS*', below)
|
||||
Show Parens -- Highlight the surrounding parenthesis
|
||||
Expand Word -- Expand the word you have typed to match another
|
||||
word in the same buffer; repeat to get a
|
||||
different expansion
|
||||
|
@ -91,6 +95,7 @@ Options Menu:
|
|||
Code Context -- Open a pane at the top of the edit window which
|
||||
shows the block context of the section of code
|
||||
which is scrolling off the top or the window.
|
||||
(Not present in Shell window.)
|
||||
|
||||
Windows Menu:
|
||||
|
||||
|
@ -138,8 +143,11 @@ Basic editing and navigation:
|
|||
Control-left/right Arrow moves by words in a strange but useful way.
|
||||
Home/End go to begin/end of line.
|
||||
Control-Home/End go to begin/end of file.
|
||||
Some useful Emacs bindings (Control-a, Control-e, Control-k, etc.)
|
||||
are inherited from Tcl/Tk.
|
||||
Some useful Emacs bindings are inherited from Tcl/Tk:
|
||||
Control-a beginning of line
|
||||
Control-e end of line
|
||||
Control-k kill line (but doesn't put it in clipboard)
|
||||
Control-l center window around the insertion point
|
||||
Standard Windows bindings may work on that platform.
|
||||
Keybindings are selected in the Settings Dialog, look there.
|
||||
|
||||
|
@ -155,6 +163,52 @@ Automatic indentation:
|
|||
|
||||
See also the indent/dedent region commands in the edit menu.
|
||||
|
||||
Completions:
|
||||
|
||||
Completions are supplied for functions, classes, and attributes of
|
||||
classes, both built-in and user-defined. Completions are also provided
|
||||
for filenames.
|
||||
|
||||
The AutoCompleteWindow (ACW) will open after a predefined delay
|
||||
(default is two seconds) after a '.' or (in a string) an os.sep is
|
||||
typed. If after one of those characters (plus zero or more other
|
||||
characters) you type a Tab the ACW will open immediately if a possible
|
||||
continuation is found.
|
||||
|
||||
If there is only one possible completion for the characters entered, a
|
||||
Tab will supply that completion without opening the ACW.
|
||||
|
||||
'Show Completions' will force open a completions window. In an empty
|
||||
string, this will contain the files in the current directory. On a
|
||||
blank line, it will contain the built-in and user-defined functions and
|
||||
classes in the current name spaces, plus any modules imported. If some
|
||||
characters have been entered, the ACW will attempt to be more specific.
|
||||
|
||||
If string of characters is typed, the ACW selection will jump to the
|
||||
entry most closely matching those characters. Entering a Tab will cause
|
||||
the longest non-ambiguous match to be entered in the Edit window or
|
||||
Shell. Two Tabs in a row will supply the current ACW selection, as
|
||||
will Return or a double click. Cursor keys, Page Up/Down, mouse
|
||||
selection, and the scrollwheel all operate on the ACW.
|
||||
|
||||
'Hidden' attributes can be accessed by typing the beginning of hidden
|
||||
name after a '.'. e.g. '_'. This allows access to modules with
|
||||
'__all__' set, or to class-private attributes.
|
||||
|
||||
Completions and the 'Expand Word' facility can save a lot of typing!
|
||||
|
||||
Completions are currently limited to those in the namespaces. Names in
|
||||
an Edit window which are not via __main__ or sys.modules will not be
|
||||
found. Run the module once with your imports to correct this
|
||||
situation. Note that IDLE itself places quite a few modules in
|
||||
sys.modules, so much can be found by default, e.g. the re module.
|
||||
|
||||
If you don't like the ACW popping up unbidden, simply make the delay
|
||||
longer or disable the extension. OTOH, you could make the delay zero.
|
||||
|
||||
You could also switch off the CallTips extension. (We will be adding
|
||||
a delay to the call tip window.)
|
||||
|
||||
Python Shell window:
|
||||
|
||||
Control-c interrupts executing command.
|
||||
|
@ -165,7 +219,7 @@ Python Shell window:
|
|||
|
||||
Alt-p retrieves previous command matching what you have typed.
|
||||
Alt-n retrieves next.
|
||||
(These are Control-p, Control-n on the Mac)
|
||||
(These are Control-p, Control-n on the Mac)
|
||||
Return while cursor is on a previous command retrieves that command.
|
||||
Expand word is also useful to reduce typing.
|
||||
|
||||
|
@ -196,7 +250,7 @@ Other preferences:
|
|||
be changed using the Settings dialog.
|
||||
|
||||
Command line usage:
|
||||
|
||||
|
||||
Enter idle -h at the command prompt to get a usage message.
|
||||
|
||||
Running without a subprocess:
|
||||
|
@ -211,3 +265,18 @@ Running without a subprocess:
|
|||
re-import any specific items (e.g. from foo import baz) if the changes
|
||||
are to take effect. For these reasons, it is preferable to run IDLE
|
||||
with the default subprocess if at all possible.
|
||||
|
||||
Extensions:
|
||||
|
||||
IDLE contains an extension facility. See the beginning of
|
||||
config-extensions.def in the idlelib directory for further information.
|
||||
The default extensions are currently:
|
||||
|
||||
FormatParagraph
|
||||
AutoExpand
|
||||
ZoomHeight
|
||||
ScriptBinding
|
||||
CallTips
|
||||
ParenMatch
|
||||
AutoComplete
|
||||
CodeContext
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue