Code Editor (Scintilla)
HarbourBuilder's code editor is powered by Scintilla 5.5+, the same editing component used by Notepad++, SciTE, and Code::Blocks. It provides professional code editing features with Harbour-aware syntax highlighting and intelligent code folding.
All three platforms use Scintilla 5.5+ — Windows uses dynamic DLLs, macOS uses static libraries, and Linux uses shared libraries. The editing experience is identical across platforms.
Platform-Specific Scintilla Setup
| Platform | Library Type | Files |
|---|---|---|
| Windows | Dynamic libraries | Scintilla.dll, Lexilla.dll |
| macOS | Static libraries | libscintilla.a, liblexilla.a |
| Linux | Shared libraries | libscintilla.so, liblexilla.so |
Syntax Highlighting
The editor uses a VS Code Dark+ color theme with Harbour-aware syntax highlighting:
| Token Type | Color | Style | Example |
|---|---|---|---|
| Keywords | Blue | Bold | function, return, local |
| Commands | Teal | Normal | DEFINE FORM, BUTTON, |
| Comments | Green | Italic | // This is a comment |
| Strings | Orange | Normal | "Hello World" |
| Numbers | Light Green | Normal | 400, 3.14 |
| Preprocessor | Magenta | Normal | #include, #xcommand |
Code Folding
Harbour-aware code folding understands xBase language structures:
function/return— Function boundariesCLASS/ENDCLASS— Class definitionsif/endif— Conditional blocksfor/next— For loopsdo while/enddo— While loopsswitch/endswitch— Switch statementsbegin sequence/end sequence— Exception handling#pragma begindump/#pragma enddump— C code embedding
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl+F / Cmd+F | Open Find bar |
| Ctrl+H / Cmd+H | Open Replace bar |
| Ctrl+Space / Cmd+Space | Auto-completion (150+ keywords) |
| Ctrl+/ / Cmd+/ | Toggle line comment |
| Ctrl+Shift+D / Cmd+Shift+D | Duplicate current line |
| Ctrl+Shift+K / Cmd+Shift+K | Delete current line |
| Ctrl+L / Cmd+L | Select current line |
| Ctrl+G / Cmd+G | Go to line number |
| F12 | Go to definition (function/procedure/method/class) |
Auto-Completion
Press Ctrl+Space / Cmd+Space to trigger auto-completion with 150+ items:
- Harbour keywords — function, return, local, static, class, method, etc.
- Harbour functions — MsgInfo(), MsgStop(), hb_vfExists(), etc.
- xBase commands — DEFINE FORM, BUTTON, LABEL, ACTIVATE, etc.
Bracket Matching
The editor automatically highlights matching brackets:
- Matching pairs —
(),[],{}highlighted in yellow - Unmatched/bad brackets — Highlighted in red
Bookmarks
Set bookmarks to quickly navigate to important code locations:
| Shortcut | Action |
|---|---|
| Ctrl+0..9 / Cmd+0..9 | Toggle bookmark at current line |
| Ctrl+Shift+0..9 / Cmd+Shift+0..9 | Jump to bookmark |
Code Snippets
Tab expansion for common code patterns:
| Snippet | Expands To |
|---|---|
forn | for nI := 1 to nCount |
iff | if condition |
cls | CLASS TClassName FROM TParentClass |
func | function FunctionName() |
proc | procedure ProcedureName() |
whil | do while .T. |
swit | switch nValue |
tryx | begin sequence ... end sequence |
Auto-Indent
When you press Enter, the editor automatically indents the new line to match the previous line's indentation level. This keeps your code properly formatted without manual spacing.
Tabbed Multi-File Editing
The editor supports tabbed editing, allowing you to work on multiple source files simultaneously. Tabs show the filename and an asterisk (*) when the file has unsaved changes.
Build Messages Panel
After building, the Messages panel appears at the bottom showing:
- Errors — Red markers with clickable file/line references
- Warnings — Yellow markers for potential issues
- Jump to source — Click any error to navigate directly to the code line
- Clear button — Clear the messages panel
Status Bar
The status bar at the bottom shows real-time editing information:
| Field | Description |
|---|---|
| Line | Current line number |
| Column | Current column position |
| INS/OVR | Insert or Overwrite mode indicator |
| Line count | Total lines in the file |
| Char count | Total characters in the file |
| UTF-8 | File encoding |
All Scintilla features are configured specifically for Harbour/xBase syntax. The lexer understands Harbour keywords, commands, and xBase-specific constructs.