Navigation

Navigating Within a File Using the Outline View

When you open a file in the IDL Editor, all functions and procedures defined in that file are listed in the The Outline view.

Select a procedure or function from the Outline list to highlight that procedure or function in the Editor. This is especially useful for navigating large program files containing multiple procedures and functions.

Figure 5-1: Outline View

proc_func.gif

Next Previous Navigation

Use this feature to navigate to the next or previous element, depending on the context of search, errors, or comparisons. For example, Next/Previous navigates to the next search item if you have just done a search and the Search View is active. If you are viewing a list of errors, you can navigate to the next or previous error.

Ctrl+. is the shortcut key for NavigateNext and Ctrl+, is the shortcut for NavigatePrevious.

Go to Last Edit Location

Use this feature to find your latest edits. Ctrl+Q or the toolbar button ed_lastedit.gif highlights the last change you made.

Executing Blocks of Code

You can quickly execute code contained in an editor window in the following ways:

See Execute Code from the Editor for additional details.

Commenting Blocks of Code

The IDL Workbench provides methods to quickly comment and uncomment single or multiple lines of code. Select the lines you want to comment or uncomment (or simply place the cursor somewhere on the desired line) and use one of the following methods:

Table 5-1: Block Comment Methods

Method
Description

Toolbar

Click the Toggle Comment toolbar button. If the code is currently uncommented, this button marks it as commented. Click the button again to uncomment the code.

comment.jpg

Menu

Use the SourceToggle Comment menu item.

Context menu

Right click over a line (or block of selected lines) to display the context menu. Select Toggle Comment.

Code Templates

Code Templates are snippets of code that can be inserted into an editor window using Content Assist. The IDL Workbench provides a set of templates for common code structures including loop constructs like FOR and WHILE, branching constructs like IF and CASE, and function and procedure definitions. You can also define your own code templates and insert them using Content Assist.

To insert a code template, press Ctrl+Space, select the template from the Content Assist window, and press Enter.

Some templates "wrap" the selected lines in the template code. For example, suppose you have selected the following line in an editor window:

PRINT, var 

Press Ctrl+Space and select FOR - Iterate over the selected code from the Content Assist window. The editor now contains:

template.gif

The two selected items — index and length — represent IDL variables you must supply.

See Templates for additional information.

Tip
Code templates that consist of a single line can also be inserted into the Command Line view. See Inserting a Template into the Command Line View for additional details.

Searching Within a File

Search within the current editor using the Find/Replace dialog (EditFind or Ctrl-F). This mechanism allows you to locate and optionally replace text within a single file.

Finding a String Incrementally

Use Incremental Find to quickly find a string. To use this feature, press Ctrl+J and begin typing the search string. The Editor will highlight the first occurrence of the string (based on where your cursor is placed). To find the next occurrence, press Ctrl+J again. To find the previous occurrence, press Ctrl+Shift+J. Press Enter or Esc to exit Incremental Find mode.

Highlighting Matches

Use Highlight Selected Words to mark all instances of a selected word or words in the current editor. Position the cursor within a word to highlight other instances of that word, or select two or more complete words to highlight matching strings.

The Highlight Selected Words feature is disabled by default. To enable the feature, open the Preferences → IDL → Editor preferences page and check the Highlight other occurrences of the currently selected word or words checkbox. To change the look of the highlighting, click the Configure highlighting... link to display the Annotations preference page, then select Occurrences from the list of Annotation types.

Searching a Workspace

Search multiple files using the Search dialog (SearchSearch... or Ctrl+H). This mechanism allows you to search for text strings within multiple files contained in your workspace directory, displaying results in the Search view.