Files and the in-app editor
Browse your worktree's files in the sidebar and make quick edits without leaving Tegment.
The Files tab in the right sidebar shows a file tree for the worktree you have selected, and clicking a file opens it in a built-in editor. It is for the quick edits that would otherwise mean a trip to your IDE: fix a typo in a config, tweak a value an agent got wrong, read a file the agent just wrote.
For anything bigger, Open in IDE is still there. The in-app editor complements your IDE rather than replacing it.
The file tree#
The right sidebar has two tabs: Changes (the file changes view) and Files. Tegment remembers which one you had open.
The tree is rooted at the active worktree and follows your selection, so switching worktrees switches the tree.
- Expanded folders, loaded listings, and your selection are kept per worktree, so clicking around terminals and conversations and coming back leaves the tree exactly as you left it.
node_modulesand.gitare hidden.- The tree is a full ARIA tree, so arrow keys expand, collapse, and move through it, and Enter opens the selected file.
The editor#
A file opens as a full panel in the center of the app, the same way settings do, so it gets the whole area instead of a cramped modal.
- Save with Ctrl+S. A dot on the header marks unsaved changes, and Reset throws them away and reloads from disk.
- If something else changes the file while you have it open (an agent, a
git checkout, your IDE), a banner offers Reload or Keep editing. Saving over a file that changed underneath you asks first. - Word wrap toggles in the header, and your choice sticks for the next file you open.
- Binary files and very large files show a short explanation and an Open in IDE action instead of loading.
The editor belongs to the repository you opened it from. Switching repositories hides it with your unsaved changes intact, and coming back brings it up again.
Marks for what you have changed
A gutter beside the line numbers shows how each line compares to the last commit:
| Mark | Meaning |
|---|---|
| Green bar | The line is new. |
| Blue bar | The line was rewritten. |
| Red triangle | Lines were removed here. |
While you have unsaved changes, the marks follow their lines as you type above and below them. Lines you have just typed stay unmarked until you save, because the comparison is against what is on disk.
Opening a file from elsewhere#
Right-click any file in the Changes tab and choose Open in editor, next to Open in your IDE. It works for staged and unstaged entries alike. Deleted files and binary files are greyed out, since there is nothing to edit.
What Tegment allows itself#
The editor reads and writes only inside the worktree you are looking at. Paths are resolved against the real folder on disk, so a .. or a symlink pointing outside it is refused rather than followed, and Tegment never writes through a symlink. See what Tegment changes on your machine for the full picture.