There are a number of other features available in the IDE that are worth noting:
Source Index -- The top of the editor area displays a series of popup menus that act as an index into Python source files. Select from them to navigate around your source file.
Try this out by opening example2.py from your tutorial directory. If you place the cursor on the line that reads print("nested2"), you should see the following in the source index area:
Each subsequent menu lists the symbols available within the preceding nested context.
If you have turned off Show Notebook Tabs in the Editor Options Menu, the file selector menu will be prepended as follows:
Goto-Definition -- There are a number of ways to navigate to the point of definition of symbols in your source code. One is to right-click on the symbol and select Goto Definition. Another is to move the insertion cursor to the symbol and select Goto Selected Symbol Defn from the Source Menu (or press F4). The Source Assistant in Wing IDE Pro also contains links to points of definition.
Try this from example2.py with some of the symbols imported from htmllib, such as HTMLParser in the class definition for MyHTMLParser. Remember that the file htmllib.py is opened in non-sticky mode and will auto-close unless you toggle the stick pin icon to or edit the file.
Goto-Line -- Navigate quickly to a numbered source line with the Goto Line item in the Edit menu. In emacs mode, the line number is typed into the data entry area that appears at the bottom of the window. Press Enter to complete the action.
Keyboard-driven File Open -- Try the Open from Keyboard item in the File menu: This displays an interactive file selector at the bottom of the IDE window that can be much quicker for opening files than using the standard file selection dialog and allows file selection without moving your hands from the keyboard. Use Esc to cancel or Enter to select a file and the arrow keys to browse around the auto-completion list that it presents as you type.
Auto-Indentation -- Wing auto-indents lines as you type according to its static analysis of your code. This can be disabled with the Auto-Indent preference.
Another way in which Wing uses code analysis is in auto-indentation as you type, and for altering indentation or wrapping of code. For example, when you select a block of code and press the tab key, the entire block is re-indented according to the correct position of its first line relative to the preceding non-blank line of code. The Justify Text option in the Source menu also uses the source analyser to constrain re-wrapping to a single logical line of Python code.
Block Indentation -- The Tab key is defined to indent the current line or blocks of lines, rather then entering a tab character (which can be done with Ctrl-Tab). The Tab Key Action preference can be used to customize how the tab key behaves.
One or more selected lines can be increased or reduced in indentation from the Indentation toolbar group, which contains the following icons for this purpose:
Single lines or whole blocks can also be indented automatically to their appropriate position, as determined by analysis of the preceding line. If a range of lines is selected, the whole block is indented or outdented without changing the relative indents within the block. This is done from the following toolbar icon:
Note that the indentation features are also available in the Source menu, where their key bindings are listed.
Block Commenting -- Units of code can be commented out or un-commented quickly from the Source menu.
Brace Matching -- Wing highlights brace matching as you type unless disabled from the Auto Brace Match preference. The Match Braces item in the Source menu causes Wing to select all the code that is contained in the nearest matching braces found from the current insertion point on the editor. Repeated application of the command will traverse outward and forward in the file.
Text Reformatting -- Code can be re-wrapped with the Justify Text item in the Source menu. This will limit wrapping to a single logical line of code, so it can be used for wrapping an argument list or long list or tuple without altering surrounding code.
Converting Indentation Styles -- Wing's Indentation tool can be used to analyze and convert the style of indentation found in source files. See Indentation Manager for details.
Revision Control -- Wing provides integrations with the Subversion, Mercurial, Bazaar, Git, CVS, and Perforce revision control systems. These auto-enable based on the contents of your project. See the Version Control documentation for details.
Unit Testing -- Wing's Testing tool makes it easy to run and debug units tests.
OS Commands -- The OS Commands tool can be used to set up, execute, and interact with external commands, for building, deployment, and other tasks. The Build Command field in Project Properties can be used to configure and select one command to execute automatically before any debug session begins.
Code Snippets -- The Snippets tool in the Tools menu can be used to define and use code snippets for commonly repeated motifs, such as class or def skeletons or documentation templates. For details see the snippets documentation.
Bookmarks -- The Bookmarks tool in the Tools menu and bookmarking commands in the Source menu can be used to define and jump to marked locations in the editor. In Python files, these bookmarks are defined relative to the named scope in the file so they move around as the file is edited. See bookmark documentation for details.
Folding -- Unless turned off with the Enable Folding preference, Wing allows folding of editor code to hide areas that are not currently of interest. The folding is visual only so selecting across a folding and copying will copy the text including its hidden portions. Folding can be useful to get a quick summary of the contents of a source file. Refer to the Folding manual page for details.
Macros -- Keyboard/command macros are available. See the Keyboard Macros section of the manual for details.
|« 1.9. Tutorial: Source Assistant with Classes||Table of Contents||1.11. Tutorial: Further Reading »|