Moving Around
When working with large files, quick navigation is essential. Multi-Edit offers many methods of moving through a file to help you obtain this.
Options That Affect The Cursor's Position
Two options under Tools | Customize | Editing affect the cursor's position:
• Restrict Cursor: Keeps the cursor bound to the text. The cursor is not allowed to go past the end of a line, and the cursor is not allowed to go beyond the end of the file.
• Lock Cursor On V-Scroll: When checked, when you scroll up/down using Ctrl+UP or Ctrl+DOWN (in the default CUA keymap), the cursor will lock to where it is in the text, until it hits the top or bottom of the window. (The cursor may not go beyond the top or bottom of the window, so it can't stay locked to the text if you scroll the text further.)
Cursor Movement Commands
The following are some of the cursor movement commands available, and the keys assigned to the commands for the default CUA command map.
| Command | Key |
|---|---|
| Cursor up/down/left/right | Arrow Keys |
| Word Left/Right | Ctrl+Left, Ctrl+Right |
| Beginning of Line | Home (Pressing the Home key twice quickly moves the cursor to the top of the window. Pressing the Home key three times moves the cursor to the top of the file.) |
| End of Line | End (Pressing the End key twice quickly moves the cursor to the bottom of the window. Pressing the End key three times quickly moves the cursor to the end of the file.) |
| Next/Previous Paragraph | (You may assign a key to do this) |
| Next/Previous Page Break | Ctrl+PageUp/Ctrl+PageDown |
| Next/Previous Changed Line | Alt+Shift+Up/Down |
| Next/Previous Function | Alt+Shift+PageUp/PageDown Moves cursor up/down to the next/previous function definition. (Requires Multi-Tags support for current language. Alt+1 will show the current function name.) |
| Next/Prev Template Field | Ctrl+I / Ctrl+U |
| Top/Bottom of Block | (You may assign a key to do this) |
| Top of File | Ctrl+Home Or press the Home key three times quickly. |
| End of File | Ctrl+End Or press the End key three times quickly. |
| Page Up/Down | Page Up/Page Down |
| Cursor to Top/Bottom of Window | Ctrl+T / Ctrl+B Or press Home/End key twice quickly. |
| Line to Top/Bottom of Window | Alt+Ctrl+T / Alt+Ctrl+B Scrolls text until line cursor is on is at top/bottom of window. |
| Scroll Window Up/Down | Ctrl+Up / Ctrl+Down Hold the keys down for continuous scroll. |
| Center Line in Screen | Num 5 (On keypad. Num Lock must be off.) Scrolls text until the line the cursor is on is in the center of the window. |
You may always assign any key to perform any function. See Modifying a Command Map for more on assigning keys to commands. If you are using a different command map other than the default CUA map, you can see what keys are currently assigned to what functions by going to Tools | Customize | General | Keys/Commands. Scroll down in the resulting Command Mapping dialog to the Cursor Movement section. See Modifying a Command Map for more information.
Multi-Tags allows you to quickly jump to the beginning of any function in your current file or project. Load a code file into Multi-Edit and click the button on the toolbar. If Multi-Edit has Tag support for the language it will display a list of all the functions in that file. Click on the list to quickly jump to that function. For more on Multi-Tags see Multi-Tags in the chapter Working in Multi-Edit.
Goto Line / Column
Jumping to a specific line/column is easy within Multi-Edit and can be accomplished by clicking on Search | Goto Line Number, or by clicking on the Status Bar where the current line/column position is displayed (it looks something like [*] L:34 C:7 ).
The Goto line/Column dialog allows the user to specify a line number (based at 1) and column number (based at 1) for the cursor to jump to. The current line and column number will be set by default when the dialog is first displayed. This dialog can be invoked using one of the three following methods:
1. Search Menu
Selecting Search | Goto Line Number on the main menu bar.
2. Status Bar
The current line/column number is displayed in the middle of the status bar (looks like [6]L:6 C:41). Clicking on this area will enable the Goto line /column dialog.
3. Macro Call
The Goto Line/Column dialog can be called manually by clicking on Macro | Run Macro on the main menu bar, then specifying mesys^gotoline as the macro to run. It can also be called within a macro using the RM macro call [i.e. RM(“mesys^gotoline”); ].
Bookmarks
The Marker Stack
The current cursor position can be push/popped using the marker stack thus allowing you to quickly return to the saved position after moving elsewhere within the file. Select Search | Push Position onto Marker Stack to drop a mark at a position. When a marker is dropped, a little red check mark appears in the left-hand column of the line to notify the user of the dropped mark. When more than one mark is placed on the same line, a multiple checkmark icon is displayed.
To return to a marked position, select Search | Get Position from Marker Stack. This causes the cursor to be located at the saved position and the little red check mark will be removed.
Each file's marker stack can contain up to ten markers, and these markers are saved and restored across sessions.
The marker stack can actually be larger but only 10 per file are saved in the status file when exiting.
Random Access Markers
Use random access markers to drop a mark and reposition to that mark at any time regardless of mark order. This is useful for switching between multiple places in a file.
To drop a random access mark, select Search | Set Random Access Mark. A dialog with ten numbered buttons will be shown. A little red check mark will appear above all of the numbered buttons that already have active marks dropped. Select one of the numbered buttons to cause that number mark to be dropped. When this happens, a small red number corresponding to the dropped mark will appear in the left-hand column to indicate the location of the dropped mark.
To return to a saved position, select Search | Retrieve Random Access Mark. This will bring up a similar dialog as the one for dropping a mark. Select a numbered button to cause the cursor to be restored to the position saved for the selected mark. The little red check mark above a numbered button is used to indicate which random access marks have been dropped.
To clear any or all of the random access marks in a file, select Search | Clear Random Access Mark. This will display a dialog similar to the ones used for setting and retrieving random access marks. Now, when selecting a button, the number mark is cleared and removed from the current file. The ‘Clear All’ button removes all random access marks from the current file. When a random access mark is cleared, the little red number in the left-hand column is removed, as well as the little red check mark above the number button in the dialog.
Each file can contain up to ten random access markers, and these markers are saved and restored across sessions (see Sessions later in this chapter).
Using The Bookmark View
The Bookmark View is a dialog that is shown in the Tool Pane at the bottom of the Multi-Edit screen. It is shown by selecting the View | Bookmarks menu (if Bookmarks is already checked, then use View | Navigation Pane). You may also show it by using the key assigned to it (Ctrl+M in the default CUA command map). This dialog is another interface for using the random access markers but with a few additional features.
The Bookmarks view allows associating a descriptive text to each random access marker. From this dialog, it is possible to set and clear bookmarks as well as go to and/or view the text at a bookmark. There is also a single check box option called Global, which changes the behavior of random access marks. Normally each file can contain up to 10 marks, but when the Global option is checked, then only 10 marks for all the files are available, but the marks can be in any file, and going to a mark will first switch to the correct file.
To set a bookmark the following steps should be followed.
• Select the window the bookmark is to be dropped in.
• Position the cursor to the location to be book marked.
• Open the Bookmark dialog.
• Select the number of the bookmark to be set by clicking on the bookmark number.
• Set the text to associate with the bookmark in the field to the right of the ‘Set’ button. If left blank then the text on the current line will be used.
• Select the Set button.
Bookmarks are saved in the Session information.