The Text Editor Window (shown above) is the main method of viewing and editing text files in 010 Editor. Each text file that is loaded is displayed in a File Tab that shows a shortened form of the file name (the full file name can be viewed in the application title bar or in a hint popup displayed by placing the mouse cursor over the File Tab). The main area of the text editor shows the file interpreted as a series of characters (if a byte cannot be shown as a character a square symbol or cross will be displayed). On the left side of the Text Editor Window is a list of addresses and each address indicates the line number or the file position of the first byte on the line. A Ruler, located above the main area, displays the column offset from the start of each line and a small arrow indicates the current cursor position. The File Bar, located above the Ruler, is used to choose how data is displayed in the editor using the Edit As section (see Working with File Interfaces). Also, the File Bar can be used to execute Scripts or Templates (see Running Templates and Scripts).
A cursor is shown in the Text Editor Window as a vertical, flashing line and this cursor indicates the current position for inserting, deleting, or editing data. Left-click with the mouse to move the cursor or use the cursor keys on your keyboard (see Editor Keys below). When the Text Editor Window is not active, a vertical gray line, called the shadow cursor, will indicate where the cursor was located. When the editor is in Overwrite mode (see Editing Data below) the cursor will be displayed as a thick vertical line and when the editor is in Insert mode the cursor will be displayed as a thin vertical line.
To edit data in the editor, position the cursor over the character to edit and type on the keyboard. The result of editing depends on whether the editor is in Insert or Overwrite mode. In Overwrite mode (OVR appears in the Status Bar) the characters typed will replace any existing characters. In Insert mode (INS appears in the Status Bar) a new character will be inserted into the file. Note that the current Insert/Overwrite mode is stored separately for text and hex files. The current Insert/Overwrite mode can be changing using the Insert Key (see Editor Keys below) or by clicking INS/OVR in the status bar. Pressing the Delete key will delete the current character from the file.
After any edits are made a '*' character will appear in the File Tab to indicate that the file has been modified. Also, if bytes have been inserted a '*' character will appear by the file size in the Status Bar. Use the 'Edit > Undo' and 'Edit > Redo' menu options to undo or redo any modifications made to the file. The file can also be edited using the clipboard (see Using the Clipboard).
The following keys can be used while editing a text file:
- Left, Right, Up, Down - move the cursor in any direction.
- Ctrl+Left, Ctrl+Right - move the cursor to the next or last word
- Ctrl+Up, Ctrl+Down - scroll the editor up or down without moving the cursor.
- Enter - insert a new line.
- Home - move the cursor to the first character on a line.
- End - move the cursor to the last character on a line.
- Ctrl+Home - move the cursor to the top of the file.
- Ctrl+End - move the cursor to the end of the file.
- Insert - toggle Insert and Overwrite mode.
- Delete - deletes the current character from the file.
- Ctrl+Shift+Backspace - deletes the current line if no bytes are selected. If bytes are selected all lines that contain the selection are deleted.
- Ctrl+Backspace - deletes the previous word if no bytes are selected.
- Ctrl+Delete - deletes the next word if no bytes are selected.
- Tab - inserts a tab character or indents a blocks of lines if more that one line is selected at a time.
- Shift+Tab - if more than one line is selected, this option unindents the selected lines.
When editing text files that contain long lines, 010 Editor has the ability to automatically wrap lines that extend beyond the edge of the Text Editor Window (see the above image as an example). This is called Word Wrap and can be turned on or off by clicking the 'View > Linefeeds > Word Wrap' menu option, clicking the Word Wrap icon in the Tool Bar, or typing Ctrl+;. When Word Wrap is enabled, the text /wrap will appear in the Edit As section of the File Bar beside the File Interface name and the Word Wrap icon in the Tool Bar will be highlighted. Each line in the text editor that is generated because of a word wrap will have a '-' mark displayed in the Address column on the left side of the editor. As data is edited, the word wraps will automatically be updated.
A number of options exist to control how Word Wrap is performed. 010 Editor can automatically turn on Word Wrap when a file is opened that contains long lines. To turn this ability on or off see the 'View > Linefeeds > Initial Wrap State' menu option. By default wrapping is performed at the edge of the Text Editor Window; however, wrapping can be performed at a specific column using the 'View > Linefeeds > Wrap Width' menu option. Usually wrapping keeps whole words together but to allow wrapping on any letter within a word use the 'View > Linefeeds > Wrap Method' menu option. See the View Menu for more information.
When editing a word wrapped line, pressing the Home key once will go to the beginning of the line generated by wrapping (marked with '-' in the Address column) and pressing Home again will go the beginning of the whole line. Similarly pressing the End key once will go the end of the current generated line and pressing End again will go the very end of the line. Even when Word Wrap is turned off, 010 Editor will wrap any lines that are longer than the maximum allowed line length. This maximum line length can be controlled in the Text Editor Options dialog.
Right-clicking on the Text Editor Window displays a popup-menu of options. This menu is a sub-set of the Edit Menu and see the Edit Menu help topic for more information on each menu option. The Right-Click menu also provides a way of setting the current selection and see Selecting Bytes for more information. To customize the Right-Click Menu click the Customize... menu item at the bottom of the Right-Click Menu (see the Menu Options dialog for more information).
Splitting the Text Editor Window
The Text Editor Window may be split into two different areas by clicking the small button above the horizontal scroll bar (see the diagram above) and dragging the mouse down. Once the mouse is released the window will be split into a top and a bottom region (see the diagram below). Having two different regions is useful for editing two different areas of the file at the same time. The areas may be resized by moving the mouse over the line between the areas and dragging the line up or down (the mouse cursor will appear as an up-down arrow). Double-click on the dividing line to return to having a single area. Alternately, the Text Editor Window may be split or un-split using the 'Window > Split Window' menu option.
Text data can be selected by column using the special Column Mode. A quick way to create a column selection is to hold down the Ctrl key while dragging the mouse. See the separate Column Mode help topic for more information.
A Byte-Order Mark or BOM is a set of special bytes at the beginning of a text file that indicate the file contains data in a certain character set. 010 Editor supports the following byte-order marks:
- 0xFF 0xFE - Unicode Little-Endian
- 0xFE 0xFF - Unicode Big-Endian
- 0xEF 0xBB 0xBF - UTF-8
If a text file starts with any of these BOMs 010 Editor will automatically set the correct File Interface when the file is loaded. When a BOM is present in a file, '+B' will be displayed in the Status Bar and BOMs can be added or removed using the Converting Files dialog. To automatically add byte-order marks to files when they are created, see the File Interface Options dialog.
010 Editor checks if a file that is open in the editor has been changed by an external process. If a change is detected the above dialog is displayed. Click Reload to load the changes from the external process and note that any current edits on the file will be lost. Click Ignore to continue editing the file as usual without loading any external changes. After either of these buttons is clicked and 010 Editor detects new changes to the file, the above dialog will be displayed again. Click Always Reload to automatically reload any changes that are detected and 010 Editor checks for new changes every few seconds (this option is useful for editing a log file that is being written to disk from another process). Click Always Ignore to ignore any future changes to this file until the file is closed and opened again. Note that the notice about possible corrupted data only applies if a large block of data has been inserted into another file and then that block was modified by an external process (see Introduction to the Data Engine for more information).
The Editor Options and Text Editor Options dialogs can be used to control a number of options for the Text Editor Window.