The IDE edit windows allow you to edit and debug Windows batch files.

 

The IDE editor will display document changes in the margin and in the text. In the text, inserted characters appear with colored underlines and points where characters were deleted are shown with small triangles. The margin shows a block indicating the overall state of the line. The states are modified (orange), saved (green), saved then reverted to modified (green-yellow), and saved then reverted to original (cyan). The change history can be toggled on or off with the "Options / Change History" menu entry.

 

If a file in a tab edit window has been modified but not yet saved, the tab title will be prefixed with a *. When the file is saved, the * is removed.

 

If you are using TCC syntax, you can get help for the currently selected (highlighted) command / variable / function by pressing Ctrl-F1, or right-clicking the mouse and selecting Help from the context menu. You can also hover the mouse over a TCC variable name, and the IDE will pop up a tooltip with the current value. If you hover the mouse over a TCC internal command name, the IDE will pop up a tooltip with the command syntax.

 

You can change the line to be executed next when in debugging mode by moving the caret to the line and either right clicking & selecting "Jump to This Line" or by pressing Ctrl-Shift-F11. Note that if you attempt to jump into or out of a DO loop or IFF block, bad things will happen!

 

You can block select in the edit window by holding down the Alt key while selecting text with the left mouse button.

 

The edit window supports multiple selections at one time. You can select additional text by holding down the Ctrl key while dragging with the mouse. Multiple selections are added to the clipboard in order with no delimiting characters. For block selections, the line end is added after each line of text. Block selections are always copied from top to bottom, not in the order of selection.

 

The editor supports autocompletion for TCC or CMD command names, internal variables, and variable functions. To display the autocompletion dropdown, enter the partial name and then press Ctrl-Enter.

 

Margins

 

There are three possible margins on the left of the edit window:

 

The line number (selectable by the "Options / Display Line Numbers" menu option).

The Breakpoint margin (left click in this margin to set a breakpoint on this line).

The Fold margin (selectable by the "Options / Display Fold Margin" menu option), which will display a - for blocks that can be collapsed to a single line (DO, IFF, and SWITCH commands, and command groups). When a block is collapsed, the Fold margin will display a +. Left clicking in the Fold margin will toggle the fold state.

 

Syntax Coloring

 

The IDE will select the syntax lexer (colorization) based on the file extension:

 

.bat CMD (or optionally TCC)
.btm TCC
.cmd CMD (or optionally TCC)
.cssCSS
.htm HTML
.htmlHTML
.luaLua
.php PHP
.plPerl
.ps1PowerShell
.pyPython
.rbRuby
.shBash shell
.sqlSQL
.tclTcl/Tk
.vbsVBScript
.xmlXML

 

The edit window toolbar (which is configurable by clicking on the rightmost down arrow), has a number of icons to control debugging. Each has a tooltip for quick reference:

 

NewCreate a new batch file in a new tab window.
OpenOpen an existing batch file in a new tab window.
SaveSave the current batch file.
PrintPrint the current batch file.
CutCopy the highlighted selection to the clipboard and delete it from the file.
Copy Copy the highlighted selection to the clipboard.
PasteCopy the contents of the clipboard to the current cursor location.
DeleteDelete the highlighted selection.
UndoUndo the last edit.
RedoRestore the last Undo.
FindSearch for text.
Batch ArgumentsNew batch file arguments. The text will be parsed into %1 - %n batch arguments and used when the batch file is debugged.
Start DebuggingStarts the debugger. The cursor will be placed on the first line.
Pause DebuggingPause execution at the next line.
Stop DebuggingStops the debugger.
Step IntoExecute the current line.
Step OverExecute the current line but disable the debugger during a CALL or GOSUB.
Run to BreakpointExecute the batch file, stopping at the next breakpoint.
Toggle BreakpointSets or turns off a breakpoint on the current line.
Clear BreakpointsClear all breakpoints in the current batch file.
File PropertiesDisplays information on the current batch file.
Start New ShellStart another copy of TCC (this is useful if you need to perform some tasks while debugging a file.)
HelpDisplay the online help.