Skip to content

Commit 246fb57

Browse files
authored
Merge pull request #24 from code4mk/feature/code-editor
Feature/code editor
2 parents 3e6fb09 + 7c78337 commit 246fb57

45 files changed

Lines changed: 10889 additions & 367 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Inspired by [Fig](https://fig.io) (now part of AWS), FigyTerm is an open-source
3232
- **Multiple Tabs** — Browser-style tab bar with drag-to-reorder and rename support
3333
- **Embedded Browser** — In-app browser modal with tabs, address bar, and back/forward/reload (`⌘⇧B`); uses a native child webview so real sites load (not an iframe). On Linux it's positioned through a `gtk::Fixed` of our own, since Tauri can't place child webviews on GTK ([tauri#10420](https://github.com/tauri-apps/tauri/issues/10420))
3434
- **Embedded Code Editor** — A real editor beside the shell (`⌘⇧E`): CodeMirror 6, file tabs, a breadcrumb, and a resizable file tree. Click a `path:line:col` in terminal output and it opens there. Atomic saves with conflict detection, CRLF and BOM preserved, crash-safe drafts. Workspaces remember their own open tabs; fuzzy file finder (`⌘P`) and streamed project search (`⌘⇧F`). Loaded on first open, so it costs nothing at launch — see [the design notes](docs/CODE-EDITOR.md)
35+
- **Git in the Editor** — Changed files badged in the tree, changed lines marked in the gutter, a branch indicator in the status bar, and a GitHub Desktop-style panel: tick the files, write a summary, commit. A history tab where a commit opens into a drawer with its message and files, plus fetch and push. Discards to the trash, and runs your own `git`, so your hooks and credential helper apply
36+
- **A Real Diff Viewer** — Unified or split, with word-level highlighting inside changed lines, and five presets (GitHub, GitLab, VS Code, delta, plain `git diff`) so it reads like the tool you already use
3537
- **Markdown Preview** — GitHub-flavoured rendering with a live outline, scroll synced both ways, and clickable in-page and sibling-file links. No `dangerouslySetInnerHTML` anywhere, so a document can't inject markup
3638
- **Command History Search** — Fuzzy-search past commands with picture-in-picture mode (`⌘R`)
3739
- **System Monitor** — Live CPU and memory charts in a draggable modal (`⌘⇧M`)
@@ -244,7 +246,10 @@ that would collide (`Ctrl+Shift+T` and `Ctrl+Shift+D` are already taken) fall ba
244246
| `⌘ S` | `Ctrl+S` | Save |
245247
| `⌥ ⌘ S` | `Ctrl+Alt+S` | Save all |
246248
| `⌘ P` | `Ctrl+P` | Go to file |
247-
| `⌘ F` | `Ctrl+F` | Find in file (replace lives in the panel) |
249+
| `⌘ X` `⌘ C` `⌘ V` | `Ctrl+X` `Ctrl+C` `Ctrl+V` | Cut, copy, paste |
250+
| `⌘ F` | `Ctrl+F` | Find in file |
251+
| `⌥ ⌘ F` | `Ctrl+H` | Find and replace |
252+
| `↵` / `⇧ ↵` | `Enter` / `Shift+Enter` | Next / previous match, in the find field |
248253
| `⌘ ⇧ F` | `Ctrl+Shift+F` | Search in folder |
249254
| `⌘ G` | `Ctrl+G` | Go to line |
250255
| `⌘ W` | `Ctrl+W` | Close file tab |
@@ -259,6 +264,11 @@ takes `Ctrl+Shift` elsewhere is that a bare `Ctrl`+letter belongs to the shell
259264
and inside the editor no shell has focus, so the conventional editor chords are
260265
free to mean what they usually mean.
261266

267+
Right-clicking the text gives you cut, copy, paste, select all, undo, redo,
268+
find, go to line, save and the path actions; right-clicking the file tree gives
269+
you the file operations. Replace is `⌥⌘F` on macOS rather than the usual `⌘H`,
270+
which belongs to the system.
271+
262272
## Code Editor
263273

264274
`⌘⇧E` opens an editor over the terminal, rooted at the focused pane's working
@@ -269,9 +279,17 @@ factor, no platform-specific container, and identical behaviour on all three
269279
platforms. [The design notes](docs/CODE-EDITOR.md) go into why that difference
270280
matters.
271281

272-
**Editing** is CodeMirror 6 — multi-cursor, folding, bracket matching, a real
273-
search panel, and per-language grammars fetched on demand so opening a `.tsx`
274-
doesn't pay for Rust and Python. There's no language server; word completion
282+
**It has its own settings** — the gear in the toolbar. Font, size and line
283+
height are the editor's, not the terminal's, since code and a shell rarely want
284+
the same one; leave them blank and they follow the terminal. Indentation
285+
guides, word wrap, bracket closing, word completion, hidden files and the diff
286+
style all live there too, and every control applies as you change it.
287+
288+
**Editing** is CodeMirror 6 — multi-cursor, folding, bracket matching,
289+
indentation guides that highlight the block you are in, a real find-and-replace
290+
panel with a match count, and
291+
per-language grammars fetched on demand so opening a `.tsx` doesn't pay for
292+
Rust and Python. There's no language server; word completion
275293
from the open document covers the "finish this identifier" case.
276294

277295
**Saving is the part that had to be right.** Writes go to a sibling temp file
@@ -286,6 +304,29 @@ are journalled while you type and offered back after a crash.
286304
a stack trace, a `grep -n` hit — and open at the right line. The tree offers
287305
"open a terminal here". The workspace follows the shell.
288306

307+
**Git is built in.** Changed files are coloured and badged in the tree, changed
308+
lines get a bar in the gutter beside the line number, and the branch (with
309+
ahead/behind) sits in the status bar. The changes panel is shaped like GitHub
310+
Desktop's: one list of what changed, a checkbox per file for what goes in the
311+
next commit, and a summary/description box with **Commit N files to `main`**.
312+
Clicking a file opens its diff against HEAD in a `diff-check` tab beside your
313+
files, **unified or split**, with the changed *words* inside a line highlighted
314+
the way GitHub does it — and a style picker covering GitHub, GitLab, VS Code,
315+
delta and plain `git diff`, so it can look like whichever one you already read
316+
diffs in. It shells out to your own `git`, so
317+
your hooks, credential helper and `.gitattributes` all apply. Discarding an
318+
untracked file moves it to the trash rather than deleting it, which is the one
319+
thing `git clean` gets wrong for an editor. A **History** tab lists your commits, and
320+
opening one slides in a drawer with its message — folded behind **Read more**
321+
when it's long — and the files it touched, counted by what happened to them
322+
("24 edited · 6 new · 1 deleted"). Click a file to diff it at that revision, or
323+
Back to return to the list. A commit's SHA and the branch name are links — they
324+
open on GitHub, GitLab or Bitbucket, worked out from your remote.
325+
**Fetch** and **Push** are there — push publishes a branch that
326+
has no upstream yet. Hunk-level staging, branch switching and pull are
327+
deliberately left to the shell: a pull can leave a conflict, and a merge editor
328+
is a feature of its own.
329+
289330
**Workspaces** each remember their own open tabs and expanded folders, can be
290331
starred, and are switched from a picker (click the folder name in the
291332
breadcrumb). Both the editor and the browser can go picture-in-picture or

0 commit comments

Comments
 (0)