Files
8bitworkshop/src/docs/editor.md
T

2.1 KiB

Editor

The source editor is based on CodeMirror 6. Syntax highlighting is chosen from the toolchain that handles the file's extension, so a .c file opens as C, a .ca65 file as 6502 assembly, and so on. Every edit triggers a rebuild; see the IDE overview.

File windows

The sidebar lists one entry per file in the project:

  • Source files — the main file and any file reached by an #include or //#link directive. These open in the editable source editor. See Build Directives.
  • Listings — compiler/assembler listings (for example .lst or symbol listings) generated by the build. These open read-only. The view follows the program counter while debugging and supports Go To Address.
  • Toolchain headers — clicking the badge next to an #include line opens the referenced header from the toolchain's bundled include filesystem in a read-only viewer.
  • Binary files — binary files open in a read-only hex dump.

Gutter

For some platforms, the gutter shows additional information next to source lines:

  • Hex offset -- The offset of a given source line.
  • Code bytes -- The bytes for a given assembly instruction.
  • CPU Cycles -- The number of CPU cycles for a given assembly instruction.
  • Click the hex offset (or the yellow arrow) to run and break on that line.
  • Click the red circle to toggle a breakpoint — see Breakpoints.

Editor keyboard shortcuts

Editing

Shortcut Action
Tab Insert spaces or a tab character (per settings) or indent selection
Shift+Tab Unindent the current line or selection
mod+Z Undo
mod+Shift+Z Redo
mod+F Find
mod+G Find next match
mod+D Select the next occurrence of the selection
mod+Shift+Backspace Delete the current line

The editor also inherits the standard CodeMirror 6 keymap, including cursor/word movement and selection with the arrow keys, and cut/ copy/paste (mod+X, mod+C, mod+V).