Skip to content
Terminal > Code

Built-in editor

A fast editor with syntax highlighting, completion, and save-time checks.


Mel ships a real editor so quick fixes never force a context switch. It opens files from the project explorer, global search results, and the code review panel, and it speaks to the same language servers as the rest of the app.

Opening files

  • Project explorer (tools panel, Ctrl+Shift+\ (⌃\ on a Mac)): double-click any file.
  • Global search (Ctrl+Shift+F, or ⌘⇧F on a Mac): click a hit — the editor opens at that exact line, in a side panel next to your terminal.
  • Code review panel: click ✎ on a file card, or Ctrl+click (⌘-click on a Mac) an identifier in a diff to jump to its definition. Files opened from inside the review flow fill the window.

The editor always opens scrolled to the target line when there is one.

What you get

  • Header: a back button (✕), the file path, a dirty-state ● when you have unsaved changes, and a live status — saved, "Ctrl+S to save", checking…, or ✗ N errors.
  • Gutter: line numbers rendered in the same monospace font as the code, so everything lines up — absolute or relative, in Settings → Editor and Code Review.
  • Highlighting: full syntax highlighting (syntect) via a custom layouter — the buffer stays a plain editable text field underneath.
  • Diagnostics: with a language server enabled, the document syncs on a short debounce as you type and errors stream into the footer live — no save needed. Without a server, Rust files fall back to running cargo check on save.

Completion

Type two or more identifier characters and a popup appears with matching identifiers drawn from the current buffer:

  • ↑ / ↓ — move the selection
  • Tab — accept the selected completion
  • Escape — dismiss

These keys are consumed by the popup before the text field sees them, so accepting a completion never inserts a stray tab.

Saving

Ctrl+S (⌘S on macOS) writes the file to disk. If you opened the editor from the review panel, closing it reloads the diff so the cards reflect what you just changed.

  • A file changed on disk is never overwritten by surprise. If something else (the agent, git, another editor) changed the file while you were editing, the header says "changed on disk — Ctrl+S overwrites it", and your edits stay in the editor. Press Ctrl+S again to save over it, or leave to drop your edits.
  • Auto save (Settings → Editor and Code Review, off by default) saves a second after you stop typing and when you leave the editor.

Promote to a tab

The path area in the editor header is a drag handle. Drag it out of the panel and release: Mel creates a new tab titled with the file path, and the editor expands to fill it. Use this when a "quick look" turns into a real editing session and you want your terminal split back.