diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/fs.md | 2 | ||||
| -rw-r--r-- | docs/tags.md | 41 |
2 files changed, 43 insertions, 0 deletions
@@ -211,6 +211,8 @@ A line written to `look` is a right click on it: too. - a directory types `ls` into a terminal idle there, else opens one there. - a URL opens in the browser. +- in a diff pane, a whole line of the diff opens the place it names, as a + right click on its first column does ([tags.md](tags.md#reviewing-diffs)). - a plain word selects its next place after dot, wrapping (`LookWord list` on the root ctl lists every place in a `+Search` pane instead). In a terminal a word is always listed, rows spelled `@p3:12:5-9`. diff --git a/docs/tags.md b/docs/tags.md index 93c8a6fa..51977390 100644 --- a/docs/tags.md +++ b/docs/tags.md @@ -30,6 +30,15 @@ A tag word runs as acme's does, in the pane's directory with no file named: or select the name and middle-click `wc`, which takes a held selection as its argument. +A program that tracks the mouse gets it; hold Shift for pardes's own. In +raw terminal input, a program that asked for the mouse (xterm's 1000, 1002 +or 1003: htop, vim with `mouse=a`, codex) gets the clicks, drags and wheel +over its grid, reported in the format it chose and with its modifiers. +Shift-click selects, executes and looks as ever, and Shift-wheel scrolls +pardes's scrollback. A full-screen program that does not track the mouse +gets the wheel as arrow keys (xterm's alternate scroll, 1007). Tags, grips +and gutters stay pardes's. + `Repl python` in a terminal's tag binds it as that language's REPL ([fs.md](fs.md#repls)). `Repl` takes the languages a code fence names: ada, bash, c, c_sharp, clojure, cpp, css, elixir, erlang, fortran, go, haskell, @@ -64,6 +73,38 @@ Unsaved text shows on the pane's grip, as acme's modbutton, not in the tag. In a terminal the grip is two cells: the pane's mode (blank normal, `^` insert, `$` tty mode), then `*` while unsaved. +## Reviewing diffs + +Open a `.diff` or `.patch` file, or run `git diff` (or `git show`, `diff -u +old new`) as a command from any tag: once the command has finished, output +that starts as a diff does (a `diff --git` line, or a `--- ` line with `+++ +` and `@@` under it) is shown as one. Each hunk's code is coloured in the language of the file its +section names (`+++ b/<path>`, or `--- a/<path>` for a deleted file), its +old side (context and removed lines) and new side (context and added lines) +each parsed as one text, so a string or comment across lines colours as it +does in the file. Added and removed rows are tinted to the pane's edge, +their `+`/`-` in the tint's hue (the theme's ANSI green and red where it +has them); a file in no language pardes knows keeps the plain line colours. +Only the hunks in view are parsed, a few dozen lines at a time, each once. + +Then right-click to jump; the look's hover shows what the click takes. On +a `diff --git`, `---` or `+++` line, anywhere on it, markers included, that +is the whole line, and it opens its file: `diff --git a/x b/y` and `+++` +the new one, `---` the old one unless the `+++` under it names another (a +rename, a new file, `diff -u old/x new/x`), since the old name is the one +likely gone. On a `@@ -a,b +c,d @@` line it is the whole line again, and +opens the new file at line c. On a hunk line, the `+`, `-` or space in its +first column takes the whole line and opens the new file at that line; for +a removed line, at the new line now standing where it was (the one after +it, or the hunk's last when it went from the end of the file). The code +after it is words, looked at as ever. Paths are the repository's: pardes +walks up from the diff's directory (a command pane's own) to a `.git` or +`.jj` and drops git's `a/`/`b/`, else takes them from that directory as +written; `diff -u`'s timestamps are cut. A file that is not here (a branch +not checked out) opens nothing and says so: `Look: b/x.zig: no such file +here`, or `deleted by this diff` for a deleted one. A 9P `look` of a whole +line of the diff does the same. + ## Editing tags A tag is text like a body, with the body's normal and insert modes and undo. |
