Guide contents

Editor: browse, edit, and review

The Editor tab is a built-in code editor for the repository's working files: a file tree on the left, the editor on the right. It's not trying to replace your IDE — it's there so you can read, tweak, and review exactly what a step changed without leaving Merget.

Open it from the view switcher in the repo toolbar: Home · Map · Stats · Editor. While you're in it, the toolbar offers two left-pane modes: Explorer (the file tree) and Search (project-wide find and replace).

The file tree

The Explorer shows your working directory. Folders load their contents the first time you expand them, so even huge repos open instantly. Hidden dotfiles (.env, .gitignore, and friends) are listed too, just dimmed, so they stay reachable.

The small toolbar above the tree has three buttons: New File, New Folder, and Refresh. New entries are created next to whatever you have selected — type the name inline and press Enter (Escape cancels). A new file opens in the editor immediately.

Editing

Files open with syntax highlighting (the detected language shows as a badge next to the filename), line numbers, and soft-wrapped long lines. Markdown files additionally get a live rendered preview in a resizable pane on the right, which you can toggle off.

  • FindCmd/Ctrl+F opens the find bar, with toggles for match case, whole word, and regex, a match counter, and next/previous navigation (Enter / Shift+Enter). Cmd/Ctrl+H opens it with the Replace row expanded, including Replace All.
  • SaveCmd/Ctrl+S, or the save button in the header. A dot next to the filename marks unsaved changes. The editor also auto-saves about a second after you stop typing, and flushes pending edits when you switch files or leave the view, so switching around never loses work.
  • Jump to a line — use the Search mode in the left pane: it searches file contents across the whole repo (same case/whole-word/regex toggles, plus include/exclude file patterns), and clicking a match opens the file and scrolls straight to that line.

Reviewing a step's changes

When you open a changed file from Home or from a goal's details (see Navigating history), the editor switches into a read-only diff view: the whole file is shown with added lines highlighted green and removed lines re-inserted in red at their old position, scrolled to the first change. A "Diff · read-only" label appears in the header.

This works even for steps you haven't checked out — the file's content is loaded from that step's committed snapshot, not from your working directory, so you can review any point in history without moving HEAD.

Click Dismiss highlighted changes (the floating button at the bottom) to clear the diff and return to the normal, editable file.

If the GIF above doesn't load: the diff view looks like the regular editor with green and red line highlights and a Dismiss button centered near the bottom; dismissing restores the editable file at the same path.

How your edits become history

You don't commit from the editor. Saved edits land in the working directory, the committing daemon notices them like any other change, and they're committed as your (human) steps once you pause. If you've turned on manual commit mode, edits are instead held until you press the Commit button — see Settings.

Under the hood

Edits go straight to the working tree — there is no staging area in Merget, and nothing like git add. The editor writes the file on save; the committing daemon watches the filesystem, attributes the change to you (it already knows which changes were made by an agent's tools, so your edits aren't misattributed), and snapshots it into a step. The diff view is the same machinery in reverse: each step stores a full tree snapshot, so the "after" content of any file at any step can be reconstructed without touching your checkout.


Next: Browser · Related: Navigating history · Settings