diff options
| -rw-r--r-- | docs/helix-keys.md | 4 | ||||
| -rw-r--r-- | docs/macos.md | 34 | ||||
| -rw-r--r-- | docs/typ/builtins-gui.json | 2 | ||||
| -rw-r--r-- | docs/typ/builtins-tui.json | 2 | ||||
| -rw-r--r-- | docs/typ/guide.typ | 4 | ||||
| -rw-r--r-- | docs/typ/reference.typ | 4 | ||||
| -rw-r--r-- | src/CHANGELOG.md | 4 | ||||
| -rw-r--r-- | src/Jump.zig | 10 | ||||
| -rw-r--r-- | src/builtins.zig | 7 | ||||
| -rw-r--r-- | src/config.zig | 57 | ||||
| -rw-r--r-- | src/dump.zig | 4 | ||||
| -rw-r--r-- | src/keys.zig | 41 | ||||
| -rw-r--r-- | src/macos.zig | 25 | ||||
| -rw-r--r-- | src/macos/Sources/AppDelegate.swift | 46 | ||||
| -rw-r--r-- | src/macos/pardes.h | 2 | ||||
| -rw-r--r-- | test/behaviour/modes.zig | 13 | ||||
| -rw-r--r-- | test/behaviour/other_files.zig | 14 | ||||
| -rw-r--r-- | test/behaviour/settings.zig | 9 | ||||
| -rw-r--r-- | test/pdf.zig | 3 |
19 files changed, 50 insertions, 235 deletions
diff --git a/docs/helix-keys.md b/docs/helix-keys.md index 16ad856b..3e2d0ebb 100644 --- a/docs/helix-keys.md +++ b/docs/helix-keys.md @@ -110,7 +110,7 @@ language-backend queries, and the shell pipe. | `gh` / `gl` | line start / line end (last char, not the newline) | | helix-verified | | `Ctrl-d` / `Ctrl-u` | half page down/up, cursor follows | matches `page_cursor_half_down/up` | helix-verified | | `Ctrl-f` | full page down | matches `page_down`; file panes only get `Ctrl-b` (see next row) | helix-verified | -| `Ctrl-b` | file panes: full page up. Terminal panes: **toggle raw tty/editor mode** (`opts.tty_toggle`, configurable). In raw tty Esc runs `Last` and Shift-Esc goes to the child as a plain Esc (`ProgramEsc on` swaps them) | tty toggle is pardes-specific and wins on terminals; harness `pane:"tty"` cases avoid `Ctrl-b` | helix-verified (file) / pardes-specific (tty) | +| `Ctrl-b` | file panes: full page up. Terminal panes: **toggle raw tty/editor mode** (`opts.tty_toggle`, configurable). In raw tty Esc runs `Last` and Shift-Esc goes to the child as a plain Esc | tty toggle is pardes-specific and wins on terminals; harness `pane:"tty"` cases avoid `Ctrl-b` | helix-verified (file) / pardes-specific (tty) | | `PageUp` / `PageDown` | full page | matches helix `page_up`/`page_down` (view scroll + cursor snap to the scrolloff edge) | helix-verified | | `zt` / `zz` / `zb` | scroll current line to top / center / bottom | matches `align_view_top/center/bottom` (helix harness pins scrolloff to pardes' 3) | helix-verified | | `Z` | sticky view mode: the `z` keys stay armed after each until Esc, which only leaves the mode; other keys do nothing meanwhile | helix's sticky view node | helix-verified | @@ -125,7 +125,7 @@ language-backend queries, and the shell pipe. | `y` | yank each range's text into the register (`"<reg>` names one, else `"`), one value per range | line-yank vim-ism removed (phase 5); yank keeps selection AND cursor (helix). The system clipboard is `"+y` / `SPC y`, helix's own split: a `d` of one character never clobbers what the desktop holds | helix-verified | | `u` / `U` | undo / redo | restores the pre-edit selection (helix); snapshot granularity, `Alt-u`/`Alt-U` are the same two: helix walks a history tree by time with them, and pardes's history is linear, so earlier and later ARE undo and redo | helix-verified | | `p` (normal) | paste the register after each range: value i at range i, the last value repeated when there are fewer | helix `paste_impl`. `"+p` asks the system clipboard (`SPC p`); on a tty that read is OSC 52, which most terminals refuse: an honest no-op rather than a paste of the wrong text | helix-verified | -| `Esc` (body normal) | clear a pending modal prefix / exit select mode, keeping the selection, then run `Last`: hop to the pane you were in before this one, whichever kind it was, exactly like `SPC j j` — so held down it alternates between two panes, two files as readily as a file and its shell. In a PDF pane Esc first drops the mouse selection and the search highlights when the page shows any, staying where you are reading, and the next Esc hops; `Shift-Esc` hops at once. Raw tty takes unmodified Esc as `Last` and sends Shift-Esc to the program (with `ProgramEsc on`, Esc goes to the program except at a detected shell prompt) | Pardes-specific focus binding layered on helix's cleanup. A leader path, tag, topbar or search owns Esc while it is active; raw tty forwards it | pardes-specific (cleanup helix-verified) | +| `Esc` (body normal) | clear a pending modal prefix / exit select mode, keeping the selection, then run `Last`: hop to the pane you were in before this one, whichever kind it was, exactly like `SPC j j` — so held down it alternates between two panes, two files as readily as a file and its shell. In a PDF pane Esc first drops the mouse selection and the search highlights when the page shows any, staying where you are reading, and the next Esc hops; `Shift-Esc` hops at once. Raw tty takes unmodified Esc as `Last` and sends Shift-Esc to the program | Pardes-specific focus binding layered on helix's cleanup. A leader path, tag, topbar or search owns Esc while it is active; raw tty forwards it | pardes-specific (cleanup helix-verified) | | `Esc` (insert) | back to normal mode, cursor right after the insertion (no vim left-step) | | helix-verified | | `Enter` (normal) | acme **look** chord: EXPLICIT selection, else file-ish word under cursor | pardes-specific, keep (helix normal-mode Enter unbound). Covers helix `gf`. Implicit motion residue falls back to the cursor word | pardes-specific | | `Tab` (normal) | acme **execute** chord | pardes-specific, keep; explicit-selection rule as Enter | pardes-specific | diff --git a/docs/macos.md b/docs/macos.md index 9b8f82ec..d767dce2 100644 --- a/docs/macos.md +++ b/docs/macos.md @@ -722,18 +722,12 @@ A theme with `bg = null` — the curated `dark`, and every vendored `*_transparent` — declares no background of its own. In a terminal that means "wear whatever the terminal is wearing"; a window has nothing to wear, so `pardes_theme_bg` answers `PARDES_COLOR_DEFAULT` and the host goes see-through: -`window.isOpaque = false`, a clear background colour, and an -`NSVisualEffectView` (`.underWindowBackground`, `.behindWindow`, `.active`) -behind the grid when `WindowBlur` is enabled. `PardesView` stops painting the ground at all — it *clears*, +`window.isOpaque = false` and a clear background colour. `PardesView` stops painting the ground at all — it *clears*, because AppKit does not blank a non-opaque view — and any cell whose background is still the default resolves to `bgClear` and is skipped by the run loop. Reversed cells are not: a reverse puts the text colour in the background, and text is a real colour that paints. -The blur is a **sibling** of the grid inside a plain container, never its -parent. Hiding a superview hides its subviews, so a nested backdrop drew a -blank window for every opaque theme the moment it was hidden. - `WindowOpacity <0..100>` sets one background coverage throughout the frame. Background fills replace existing coverage, so overlapping ground, cell, tag and context layers cannot increase the requested opacity. The window itself @@ -741,7 +735,7 @@ stays clear below 100%; a second tinted window backdrop would compound it. Text and cursor ink stay opaque. PDFs render onto a transparent MuPDF pixmap, which preserves the coverage of text, paths, photos, and highlights. The host paints paper at `WindowOpacity`, then composites PDF content at its original -opacity. Blank paper therefore reveals the blurred backdrop while lettering +opacity. Blank paper therefore reveals the desktop while lettering stays readable even at `WindowOpacity 0`. Paper is white with `PdfTint` disabled and uses the theme background otherwise. Explicit PDF background rectangles and scanned page images remain content: this does not guess paper from pixel @@ -753,30 +747,8 @@ destination by source coverage, then add the image at the requested opacity. Theme colours and attachment rasters are interpreted as sRGB. The PDF paper separation is currently macOS-specific; other hosts keep the opaque raster path. -`WindowBlur <0..100>` controls the strength of that native backdrop independently -of `WindowOpacity`. It is a macOS-only builtin, also accepted in the startup -config and reported by `DumpConfig`. It defaults to 0 (off); 100 shows the full -AppKit material and intermediate values blend the material with the unblurred -backdrop using the effect view's alpha. An opaque themed background hides the -effect; lowering `WindowOpacity` makes the remembered strength visible again. -For example: - -```text -WindowOpacity 71 -WindowBlur 60 -``` - -This is material strength, not a Gaussian radius in pixels. AppKit's public -`NSVisualEffectView` API chooses its own blur and tint for the material. It -samples behind the window; text and cursors are drawn in a separate sibling -above the effect and remain sharp. macOS accessibility settings such as Reduce -Transparency can override the material's appearance. `WindowBlur 0` also turns -off the formerly implicit blur for background-less themes; set it to 100 to -restore that appearance. The compositor must be checked in a live window: -offscreen grid captures cannot verify behind-window blur. - `test/macos-snapshots/rendering-parity.snap` checks background colour and alpha, -regular and bottom tags, compact context separators, and PDF fit, tint and +tags, compact context separators, and PDF fit, tint and scrolling. Its native-metrics mode uses backing pixels like the shipping app; the older grid-only tests keep their display-independent point metrics. diff --git a/docs/typ/builtins-gui.json b/docs/typ/builtins-gui.json index 996ea7fa..6a5856a9 100644 --- a/docs/typ/builtins-gui.json +++ b/docs/typ/builtins-gui.json @@ -47,7 +47,6 @@ {"name": "Incl", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "acme's Incl, for the session: `Incl dir ...` adds directories a look at a name found nowhere else is tried in (`stdio.h`, `<foo.h>`), bare lists them, `Incl -` empties the list."}, {"name": "Index", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Run the file's language indexer at its project root, writing the index.scip the language words ask first."}, {"name": "Joincol", "leader": "SPC c j", "also": ["topbar"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Fold the active pane's column into the one on its right, keeping its panes."}, - {"name": "JumpScope", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "file, all", "doc": "What Back and Forward keep to: file, the focused pane's file until it runs out that way, or all, every place in order."}, {"name": "JumpTrail", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "on, off", "doc": "A jump of the cursor leaves a short trail that fades, on or off."}, {"name": "Jumplist", "leader": "SPC j l", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "List the places jumped from, each a place to go."}, {"name": "Kill", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "acme's Kill: stop the commands pardes started -- the lines it typed into a terminal, from an exec, a middle click or a pty/run, while their shell says they run (C mark to D)."}, @@ -76,7 +75,6 @@ {"name": "PdfTint", "leader": "SPC t i", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Tint the PDF page to the theme, or show it as printed, stepping through them (or to the one named, `disabled|filtered|full`)."}, {"name": "Pet", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "off, cat, frog", "doc": "The window's companion in the workspace tag's blank space: off, cat or frog."}, {"name": "Petscii", "leader": "SPC t p", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "glyph art over the host's pixels: an image pane's picture, or the kitty graphics a terminal's program placed (yazi's previews)"}, - {"name": "ProgramEsc", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "on, off", "doc": "In a raw terminal, Esc goes to the program and Shift-Esc backs out, on; off (the default) swaps them."}, {"name": "Putall", "leader": null, "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "acme's Putall: every pane holding unsaved edits to a file is saved, each as its own Save; one that is refused (changed on disk since, a write that fails) says so and the rest are saved all the same."}, {"name": "Recent", "leader": "SPC f r", "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "List the files opened lately, closed ones too, each a place to open again."}, {"name": "Redo", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Redo the last undone edit."}, diff --git a/docs/typ/builtins-tui.json b/docs/typ/builtins-tui.json index 010aaea1..1a6a4023 100644 --- a/docs/typ/builtins-tui.json +++ b/docs/typ/builtins-tui.json @@ -43,7 +43,6 @@ {"name": "Incl", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "acme's Incl, for the session: `Incl dir ...` adds directories a look at a name found nowhere else is tried in (`stdio.h`, `<foo.h>`), bare lists them, `Incl -` empties the list."}, {"name": "Index", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Run the file's language indexer at its project root, writing the index.scip the language words ask first."}, {"name": "Joincol", "leader": "SPC c j", "also": ["topbar"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Fold the active pane's column into the one on its right, keeping its panes."}, - {"name": "JumpScope", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "file, all", "doc": "What Back and Forward keep to: file, the focused pane's file until it runs out that way, or all, every place in order."}, {"name": "JumpTrail", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "on, off", "doc": "A jump of the cursor leaves a short trail that fades, on or off."}, {"name": "Jumplist", "leader": "SPC j l", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "List the places jumped from, each a place to go."}, {"name": "Kill", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "acme's Kill: stop the commands pardes started -- the lines it typed into a terminal, from an exec, a middle click or a pty/run, while their shell says they run (C mark to D)."}, @@ -71,7 +70,6 @@ {"name": "PdfSections", "leader": "SPC t s", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "List the PDF's sections in a pane, each a place to go."}, {"name": "PdfTint", "leader": "SPC t i", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Tint the PDF page to the theme, or show it as printed, stepping through them (or to the one named, `disabled|filtered|full`)."}, {"name": "Petscii", "leader": "SPC t p", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "glyph art over the host's pixels: an image pane's picture, or the kitty graphics a terminal's program placed (yazi's previews)"}, - {"name": "ProgramEsc", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "on, off", "doc": "In a raw terminal, Esc goes to the program and Shift-Esc backs out, on; off (the default) swaps them."}, {"name": "Putall", "leader": null, "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "acme's Putall: every pane holding unsaved edits to a file is saved, each as its own Save; one that is refused (changed on disk since, a write that fails) says so and the rest are saved all the same."}, {"name": "Recent", "leader": "SPC f r", "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "List the files opened lately, closed ones too, each a place to open again."}, {"name": "Redo", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Redo the last undone edit."}, diff --git a/docs/typ/guide.typ b/docs/typ/guide.typ index 62aab397..d69b1471 100644 --- a/docs/typ/guide.typ +++ b/docs/typ/guide.typ @@ -42,7 +42,7 @@ steps raw, normal, insert. #pairs( [#mode-box(" ") normal], [#key("Esc"): back to the previous pane (#word("Last")), unlike helix. #key("Shift-Esc"): the same.], [#mode-box("^") insert], [#key("Esc"): back to normal. #key("Shift-Esc"): out of insert and back to the previous pane.], - [#mode-box("$") raw], [#key("Esc"): back to the previous pane. #key("Shift-Esc"): an Esc to the program. Either way the terminal stays raw. #word("ProgramEsc") `on` swaps them back: #key("Esc") goes to the program, except at a shell prompt with nothing typed on it, and #key("Shift-Esc") always goes back.], + [#mode-box("$") raw], [#key("Esc"): back to the previous pane. #key("Shift-Esc"): an Esc to the program. Either way the terminal stays raw.], [a PDF], [#key("Esc"): clears the selection and the search highlights, and with none shown goes back to the previous pane. #key("Shift-Esc"): back at once.], ) @@ -55,7 +55,7 @@ the next pane down the column. #pairs( [#key("Ctrl-w") or #key("SPC w")], [window mode (#word("Window")): each pane's tag box shows a letter instead of its mode, and the focused pane's tag is outlined; #keys("h", "j", "k", "l") move the outline, #key("Enter") or #key("Esc") gives that pane the keyboard, #key(":") its tag, a pane's letter gives it that one. #key("k") past a column's top pane goes on to its tag. #key("d") is #word("Del") on the outlined pane (between two panes it waits for #key("k") or #key("j"), as #key("SPC d") does) and the outline moves to the pane that took its rows; #key("c") is #word("Collapse"). The mode stays on for the next key], - [#keys("Ctrl-o", "Ctrl-i")], [back and forward through the places you jumped to (the jump list), this file's first: another file's only once it has none left that way (#word("JumpScope") `all`: every place in order). #key("Ctrl-i") needs the kitty keyboard protocol or the GUI, being #key("Tab") elsewhere: there use #key("SPC j i") and #key("SPC j o"), or the mouse's side buttons], + [#keys("Ctrl-o", "Ctrl-i")], [back and forward through the places you jumped to (the jump list), this file's first: another file's only once it has none left that way. #key("Ctrl-i") needs the kitty keyboard protocol or the GUI, being #key("Tab") elsewhere: there use #key("SPC j i") and #key("SPC j o"), or the mouse's side buttons], ) Raw mode sends almost every key to the program. Leave it (#key("Ctrl-b")) diff --git a/docs/typ/reference.typ b/docs/typ/reference.typ index c9e117e8..72d0b5ee 100644 --- a/docs/typ/reference.typ +++ b/docs/typ/reference.typ @@ -440,8 +440,6 @@ word clicked in a tag does. The same lines go in the startup file [#word("ThemeFile") `<path>`], [a `.zon` theme, relative to the config directory; reloads live when saved], [#word("Verbose")], [on: a builtin announces its name on the message row], [#word("MessageLinger")], [800 milliseconds, at most 60000: how long a message stays after the key or click that dismisses it], - [#word("ProgramEsc")], [off: in a raw terminal #key("Esc") goes back a pane and #key("Shift-Esc") is the program's Esc; on swaps them, and #key("Esc") goes back only at an empty shell prompt], - [#word("JumpScope") `file|all`], [`file`: #word("Back") and #word("Forward") keep to the focused pane's file, that pane's places first, then the file's in another pane, and go to another file only when the file has no place left that way; from a terminal or a pane with no file they step through every place; `all`: every place, in the order it was jumped to], [#word("Shell") `<name or path>`], [`$SHELL` when it is executable, else `/bin/sh`: the shell the next terminal and command pane run; a bare name is searched for in the usual bin directories, not `$PATH`; bare #word("Shell"): `$SHELL` if it is executable, else `/bin/sh`], [#word("DumpDir") `<dir>`], [`$XDG_DATA_HOME/pardes`, else `~/.local/share/pardes`: the directory of the state file, `pardes.xitdb`, which keeps Recent and the dumps and which every session of the user shares (one that cannot be read as one is kept aside as `pardes.xitdb.broken` and a new one started); an absolute or `~` path to a directory that may be written (made if missing); a relative one, or one under a directory that may not be written, is refused; bare returns to the default], [#word("TreeContext")], [off: sticky declaration headers in a source pane, in the tagline style (per pane, dumped)], @@ -1027,7 +1025,7 @@ to its end before the write is answered, and one that finds nothing fails, = On screen <on-screen> -- *Esc at a prompt* (with #word("ProgramEsc") on). pardes knows a shell prompt with nothing typed on it +- *A command at a prompt.* A command run from a terminal's text is typed at its shell when the shell sits at a prompt with nothing typed on it, else run in a pane of its own. pardes knows such a prompt from the OSC 133 marks it injects into bash and fish (marks a shell sends itself do not count); for other shells, from no program holding the terminal, typed text or not. diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index ba9bc911..69d9d649 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -19,6 +19,10 @@ - SearchPlace, SearchPane and SearchRows: a query pane is attached under the pane that asked, eight rows under its line 1, and the next search from that pane reuses it; the finder column is gone with them. + - ProgramEsc: in a raw terminal Esc goes back a pane and Shift-Esc is + the program's Esc. + - JumpScope: Back and Forward keep to the focused pane's file first. + - WindowBlur: the macOS window draws no blur behind a translucent ground. - What pardes keeps on disk is in xitdb databases now (a pinned commit of github.com/xit-vcs/xitdb, pure Zig). The state file, `pardes.xitdb` in diff --git a/src/Jump.zig b/src/Jump.zig index 131d7e9d..2220f3c8 100644 --- a/src/Jump.zig +++ b/src/Jump.zig @@ -226,10 +226,10 @@ pub fn trackJump(p: *Pardes) void { /// 9P exec. `jcur` is the entry where you are; the step moves it to the /// entry it lands on, and the entries it passed over stay where they are. /// -/// JumpScope file, from a pane with a file: the nearest entry that way in -/// this pane, else in this file in any pane (a closed one's too), else, -/// with none of this file left that way, the nearest of any file, as -/// JumpScope all always takes. Forward mirrors Back, so it retraces a run +/// From a pane with a file: the nearest entry that way in this pane, else +/// in this file in any pane (a closed one's too), else, with none of this +/// file left that way, the nearest of any file; from a terminal or a +/// scratch, the nearest of any. Forward mirrors Back, so it retraces a run /// of Backs inside one file step for step, and Forwards end, as they /// always have, at the newest entry. pub fn jumpBy(p: *Pardes, delta: i32) void { @@ -239,7 +239,7 @@ pub fn jumpBy(p: *Pardes, delta: i32) void { return p.setMessage(p.active, if (older) "Back: nothing further back" else "Forward: nothing further on"); var next = if (older) p.jumps.cur - 1 else p.jumps.cur + 1; // A terminal or a scratch has no file to keep to: the step is global. - if (p.settings.jump_scope == .file) if (p.panes[p.active]) |here| if (Pardes.recentPlace(here)) |place| if (place.path.len > 0) { + if (p.panes[p.active]) |here| if (Pardes.recentPlace(here)) |place| if (place.path.len > 0) { const hash = if (jumpPath(here)) |path| std.hash.Wyhash.hash(0, path) else 0; // The nearest of this pane's own wins over a nearer one of this // file in another pane: the step does not move the keyboard. diff --git a/src/builtins.zig b/src/builtins.zig index 5b15a968..4c6fc367 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -22,7 +22,6 @@ pub const frontend: config.Runtime.Capabilities = .{ // The tty's font belongs to its emulator. .tagline_font_size = pardes.platform != .tui, .window_opacity = pardes.platform == .gui or pardes.platform == .macos, - .window_blur = pardes.platform == .macos, // The grip's width, the cursor's blink and the Pet are the SDL window's. .pixels = pardes.platform == .gui, }; @@ -32,8 +31,8 @@ pub const frontend: config.Runtime.Capabilities = .{ /// its own frontend does (`viewCapabilities`), so a terminal's replica of a /// window's session steps as the window's own does, and back. pub const desktop = pardes.platform == .tui or pardes.platform == .gui; -const window_capabilities: config.Runtime.Capabilities = .{ .font_picker = true, .tagline_font_size = true, .window_opacity = true, .window_blur = false, .pixels = true }; -const terminal_capabilities: config.Runtime.Capabilities = .{ .font_picker = false, .tagline_font_size = false, .window_opacity = false, .window_blur = false, .pixels = false }; +const window_capabilities: config.Runtime.Capabilities = .{ .font_picker = true, .tagline_font_size = true, .window_opacity = true, .pixels = true }; +const terminal_capabilities: config.Runtime.Capabilities = .{ .font_picker = false, .tagline_font_size = false, .window_opacity = false, .pixels = false }; /// The words this build has: a desktop build's are the window's. pub const capabilities: config.Runtime.Capabilities = if (desktop) window_capabilities else frontend; @@ -243,7 +242,7 @@ pub const registry = struct { // a switch flips bare, a choice steps, and DumpDir and Shell bare // are the default .toggle, .dump_dir, .choice, .shell => false, - .theme, .font, .tagline_size, .window_opacity, .window_blur, .message_linger, .inactive_dim, .grip_width => true, + .theme, .font, .tagline_size, .window_opacity, .message_linger, .inactive_dim, .grip_width => true, // bare, it says the current value (exec.applySettingBuiltin) .tab, .callstack_depth => false, }; diff --git a/src/config.zig b/src/config.zig index 6f45adba..3e05d7e1 100644 --- a/src/config.zig +++ b/src/config.zig @@ -114,7 +114,6 @@ pub const leader_path = paths: { .Search = null, .Panes = null, .More = null, - .JumpScope = null, .Debug = "td", .Msg = null, .Verbose = null, @@ -149,10 +148,8 @@ pub const leader_path = paths: { table.set(.MessageLinger, null); table.set(.DumpDir, null); if (builtins.capabilities.window_opacity) table.set(.WindowOpacity, null); - if (builtins.capabilities.window_blur) table.set(.WindowBlur, null); if (builtins.capabilities.pixels) table.set(.CursorBlink, null); table.set(.JumpTrail, null); - table.set(.ProgramEsc, null); if (builtins.capabilities.pixels) table.set(.GripWidth, null); table.set(.InactiveDim, null); if (builtins.capabilities.pixels) table.set(.Pet, null); @@ -259,8 +256,8 @@ pub const jump_keys = [_]struct { chord: Chord, cmd: Builtin }{ /// Shift-Esc: the Esc nothing swallows. In every mode and pane it does what /// Esc does from normal mode, back to the previous pane (Last); in a raw -/// terminal plain Esc does it and Shift-Esc is the program's Esc, unless -/// ProgramEsc is on. Ctrl-b alone toggles raw. +/// terminal plain Esc does it and Shift-Esc is the program's Esc. Ctrl-b +/// alone toggles raw. pub const back_out: []const Chord = &.{.{ .cp = Key.escape, .shift = true }}; pub const tty_toggle_default: u21 = 'b'; @@ -701,16 +698,12 @@ pub const Runtime = struct { /// A jump of the cursor leaves a short trail that fades: a setting /// alone, each frontend draws it (jump_trail.zig). jump_trail: bool = false, - /// In a raw terminal, Esc goes to the program and Shift-Esc backs out - /// (off, the default: Esc backs out and Shift-Esc is the program's). - program_esc: bool = false, /// How long a message stays after the key or click that dismisses it. message_linger_ms: u16 = 800, /// Where Dump writes and a relative Restore looks; empty is the default /// ($XDG_DATA_HOME/pardes, else ~/.local/share/pardes). dump_dir: Text(limits.host_path_cap) = .{}, window_opacity: u8 = 100, - window_blur: u8 = 0, window_opacity_pending: bool = true, /// The window's companion in the workspace tag's blank space /// (gui/pet.zig), or none: a setting alone, the window moves it. @@ -734,18 +727,13 @@ pub const Runtime = struct { tagline_percent: u8 = 100, } = .{}, - /// What Back and Forward keep to (Jump.jumpBy): `file`, the places in - /// the focused pane's file first, other files only once those run out - /// that way; `all`, every place in the order it was jumped to. - jump_scope: JumpScope = .file, /// acme's Tab: a tab's width in cells, in every pane (config.tab_now /// is what the drawing and the column arithmetic read). tab: u16 = tab_width, callstack_depth: u8 = @import("lsp/lsp.zig").callstack_default_depth, - pub const JumpScope = enum { file, all }; /// A setting that is one of a few words, each an enum field of Runtime. - pub const Choice = enum { jump_scope, pet }; + pub const Choice = enum { pet }; pub const Pet = enum { off, cat, frog }; pub const tagline_percent_min: u8 = 1; @@ -807,7 +795,6 @@ pub const Runtime = struct { font_picker: bool, tagline_font_size: bool, window_opacity: bool = false, - window_blur: bool = false, /// The shell draws its own pixels (the SDL window): the grip at /// GripWidth, its own cursor blink, the Pet. pixels: bool = false, @@ -815,7 +802,7 @@ pub const Runtime = struct { pub const Capability = std.meta.FieldEnum(Capabilities); - pub const Toggle = enum { wrap, debug, verbose, cursor_blink, jump_trail, program_esc }; + pub const Toggle = enum { wrap, debug, verbose, cursor_blink, jump_trail }; pub const Action = union(enum) { toggle: Toggle, @@ -824,7 +811,6 @@ pub const Runtime = struct { font, tagline_size, window_opacity, - window_blur, message_linger, dump_dir, /// A percentage, 0 through 100. @@ -856,7 +842,6 @@ pub const Runtime = struct { return switch (action) { .font, .tagline_size => .font_picker, .window_opacity => .window_opacity, - .window_blur => .window_blur, .grip_width => .pixels, .toggle => |field| switch (field) { .cursor_blink => .pixels, @@ -874,7 +859,6 @@ pub const Runtime = struct { .{ .word = "Verbose", .action = .{ .toggle = .verbose }, .doc = "A builtin says its own name on the message row as it runs, on or off." }, .{ .word = "CursorBlink", .action = .{ .toggle = .cursor_blink }, .doc = "The cursor blinks, solid while typing, on or off." }, .{ .word = "JumpTrail", .action = .{ .toggle = .jump_trail }, .doc = "A jump of the cursor leaves a short trail that fades, on or off." }, - .{ .word = "ProgramEsc", .action = .{ .toggle = .program_esc }, .doc = "In a raw terminal, Esc goes to the program and Shift-Esc backs out, on; off (the default) swaps them." }, .{ .word = "GripWidth", .action = .grip_width, .doc = "The grip and scrollbar width, as a percent of the theme's rail." }, .{ .word = "InactiveDim", .action = .inactive_dim, .doc = "Fade the unfocused panes' text by a percentage, 0 through 100, 0 off." }, .{ .word = "Pet", .action = .{ .choice = .pet }, .doc = "The window's companion in the workspace tag's blank space: off, cat or frog." }, @@ -885,8 +869,6 @@ pub const Runtime = struct { .{ .word = "Font", .action = .font, .doc = "The body font, by name or path, and its size." }, .{ .word = "TaglineSize", .action = .tagline_size, .doc = "Scale the tag font, a percentage." }, .{ .word = "WindowOpacity", .action = .window_opacity, .doc = "The window's opacity, a percentage." }, - .{ .word = "WindowBlur", .action = .window_blur, .doc = "The blur behind a translucent window, a radius." }, - .{ .word = "JumpScope", .action = .{ .choice = .jump_scope }, .doc = "What Back and Forward keep to: file, the focused pane's file until it runs out that way, or all, every place in order." }, .{ .word = "CallstackDepth", .action = .callstack_depth, .doc = "Caller levels collected by Callstack, 1 through 64; default 8. Bare, it says the current limit." }, .{ .word = "Tab", .action = .tab, .doc = "A tab's width in cells, 1 through 16, in every pane; bare, it says the width." }, }; @@ -917,8 +899,8 @@ pub const Runtime = struct { for (std.enums.values(Toggle)) |field| if (actionCount(.{ .toggle = field }) != 1) @compileError("runtime toggle must occur exactly once: " ++ @tagName(field)); if (actionCount(.shell) != 1 or actionCount(.theme) != 1 or actionCount(.font) != 1 or - actionCount(.tagline_size) != 1 or actionCount(.window_opacity) != 1 or actionCount(.window_blur) != 1) - @compileError("Shell, Theme, Font, TaglineSize, WindowOpacity, and WindowBlur actions must each occur exactly once"); + actionCount(.tagline_size) != 1 or actionCount(.window_opacity) != 1) + @compileError("Shell, Theme, Font, TaglineSize and WindowOpacity actions must each occur exactly once"); } pub fn apply(state: *Runtime, setting: Setting, argument: ?[]const u8) bool { @@ -945,7 +927,6 @@ pub const Runtime = struct { state.window_opacity = number(u8, argument, " \t\r\n", 0, 100) orelse return false; state.window_opacity_pending = true; }, - .window_blur => state.window_blur = number(u8, argument, " \t\r\n", 0, 100) orelse return false, // Bare, it returns to the default directory. Else an absolute or // `~` path, to a directory there or to be made, that may be // written: a Dump there could never be, refused now. @@ -999,7 +980,7 @@ pub const Runtime = struct { /// words (`choices`), else its range or the kind of thing it takes. pub fn takes(action: Action) ?[]const u8 { return choices(action) orelse switch (action) { - .inactive_dim, .window_opacity, .window_blur => "0-100 (a percentage)", + .inactive_dim, .window_opacity => "0-100 (a percentage)", .grip_width => "50-300 (a percentage)", .tab => "1-16 (cells)", .callstack_depth => "1-64 (levels)", @@ -1092,7 +1073,7 @@ pub const Runtime = struct { else try out.print("{s} {s}\n", .{ setting.word, context.theme_name }), // A number in a field named as its action. - inline .window_opacity, .window_blur, .inactive_dim, .callstack_depth, .tab, .grip_width => |_, tag| try out.print("{s} {d}\n", .{ setting.word, @field(state, @tagName(tag)) }), + inline .window_opacity, .inactive_dim, .callstack_depth, .tab, .grip_width => |_, tag| try out.print("{s} {d}\n", .{ setting.word, @field(state, @tagName(tag)) }), .dump_dir => { const dir = if (state.dump_dir.len > 0) state.dump_dir.get() else context.default_dump_dir; if (dir.len > 0) try out.print("{s} {s}\n", .{ setting.word, dir }) else try out.print("# {s} (none)\n", .{setting.word}); @@ -1228,22 +1209,6 @@ pub const Runtime = struct { try std.testing.expect(state.window_opacity_pending); } - test "window blur defaults off and validates without changing opacity" { - const setting = find("WindowBlur").?; - var state: Runtime = .{}; - try std.testing.expectEqual(@as(u8, 0), state.window_blur); - try std.testing.expectEqual(Capability.window_blur, availability(setting.action).?); - for ([_][]const u8{ "0", " 40\n", "100" }, [_]u8{ 0, 40, 100 }) |argument, expected| { - try std.testing.expect(apply(&state, setting, argument)); - try std.testing.expectEqual(expected, state.window_blur); - try std.testing.expectEqual(@as(u8, 100), state.window_opacity); - } - for ([_]?[]const u8{ null, "", " \t\n", "101", "-1", "+40", "40%", "0.5", "40 20", "4_0", "0x28", "999999999999999" }) |argument| { - try std.testing.expect(!apply(&state, setting, argument)); - try std.testing.expectEqual(@as(u8, 100), state.window_blur); - } - } - test "font request tuple rejects atomically" { var state: Runtime = .{}; try std.testing.expect(requestFont(&state, "/fonts/old.ttf", "Old", 1200)); @@ -1286,15 +1251,13 @@ pub const Runtime = struct { .font_picker = true, .tagline_font_size = true, .window_opacity = true, - .window_blur = true, .pixels = true, }, .state = &state, }; const values = [_][2][]const u8{ - .{ "TaglineSize", "73" }, .{ "WindowOpacity", "85" }, .{ "WindowBlur", "40" }, + .{ "TaglineSize", "73" }, .{ "WindowOpacity", "85" }, .{ "MessageLinger", "1500" }, .{ "DumpDir", "~/dumps" }, - .{ "JumpScope", "all" }, .{ "GripWidth", "200" }, .{ "InactiveDim", "35" }, .{ "CallstackDepth", "16" }, .{ "Tab", "8" }, }; @@ -1339,7 +1302,7 @@ pub const Runtime = struct { try writeReport(&out, defaults_context); const defaults_report = storage[0..out.end]; // A setting this shell does not have reads so, as a comment. - for ([_][]const u8{ "# WindowOpacity unsupported\n", "# WindowBlur unsupported\n", "# Font unsupported\n", "# TaglineSize unsupported\n" }) |expected| + for ([_][]const u8{ "# WindowOpacity unsupported\n", "# Font unsupported\n", "# TaglineSize unsupported\n" }) |expected| try std.testing.expect(std.mem.indexOf(u8, defaults_report, expected) != null); try std.testing.expect(std.mem.indexOf(u8, defaults_report, "Font in use") == null); // Every line before the blank one is a ctl word and its value, or a diff --git a/src/dump.zig b/src/dump.zig index 455f172d..976344b6 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -672,12 +672,12 @@ test "a dump keeps the session's settings, and a restore applies them" { const p = try Pardes.init(gpa, .{ .tty_only = true }); defer p.deinit(); try std.testing.expect(p.executeBuiltinLine(p.active, "Verbose off")); - try std.testing.expect(p.executeBuiltinLine(p.active, "JumpScope all")); + try std.testing.expect(p.executeBuiltinLine(p.active, "Wrap off")); try dumpState(p); const restored = try initFromDump(gpa, .{ .tty_only = true }, p.dump_out.?); defer restored.deinit(); try std.testing.expect(!restored.settings.verbose); - try std.testing.expectEqual(config.Runtime.JumpScope.all, restored.settings.jump_scope); + try std.testing.expect(!restored.settings.wrap); } test "a session with every column it may hold dumps and restores them all" { diff --git a/src/keys.zig b/src/keys.zig index 9f16b42a..9496d37a 100644 --- a/src/keys.zig +++ b/src/keys.zig @@ -169,9 +169,9 @@ pub fn handleKey(p: *Pardes, key: Key) void { if (p.window_pick != null) return layout.windowKey(p, key); const pane = p.panes[p.active] orelse return; layout.noteTyped(p); - // In a raw terminal the two Escs swap unless ProgramEsc is on: Esc - // backs out, and Shift-Esc is the program's, sent as a plain Esc. - const raw_esc = key.cp == Key.escape and !key.ctrl and !key.alt and !p.settings.program_esc and + // In a raw terminal the two Escs swap: Esc backs out, and Shift-Esc is + // the program's, sent as a plain Esc. + const raw_esc = key.cp == Key.escape and !key.ctrl and !key.alt and pane.isTerminal() and pane.body.mode == .tty and pane.focus == .body and pane.prompt == .none and tagline.focusedHeader(p) == null; if (raw_esc and key.shift) { @@ -210,10 +210,6 @@ pub fn handleKey(p: *Pardes, key: Key) void { p.prefix = .none; if (key.ctrl and !key.alt and key.cp == p.tty_toggle) return toggleTty(p, p.active); - // With ProgramEsc on, bare Escape leaves only at a shell prompt - // (Shift-Esc, above, always). - if (key.cp == Key.escape and !key.ctrl and !key.alt and !key.shift and exec.takesCommandLine(p, p.active)) - return exec.runBuiltin(p, .Last, p.active, "", null); panes.terminal.followOutput(pane); // typing snaps back to live output // Paste stays the window's, the one exception to forwarding a raw // tty's keys: Ctrl-V types the register at the program and @@ -642,37 +638,6 @@ test "raw tty Esc backs out and Shift-Esc is the program's Esc" { try std.testing.expectEqualStrings("\x1b", test_api.ptyBytes(p, null, &buf)); } -test "with ProgramEsc raw tty Escape only leaves at a shell prompt" { - const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 24, .file = "mise.toml" }); - defer p.deinit(); - p.settings.program_esc = true; - _ = exec.spawnTty(p, 0); - const shell = p.active; - const pane = p.panes[shell].?; - var buf: [256]u8 = undefined; - _ = test_api.ptyBytes(p, null, &buf); - - // Ordinary keys reach the child; Shift-Escape is the one unconditional way - // out and sends it nothing. - p.update(.{ .key = .{ .cp = 'x', .text = "x" } }); - try std.testing.expectEqual(shell, p.active); - try std.testing.expect(test_api.ptyBytes(p, null, &buf).len > 0); - - p.update(.{ .key = .{ .cp = Key.escape, .shift = true } }); - try std.testing.expectEqual(@as(usize, 0), p.active); - try std.testing.expectEqualStrings("", test_api.ptyBytes(p, null, &buf)); - try std.testing.expectEqual(Text.Mode.tty, pane.body.mode); - - p.update(.{ .key = .{ .cp = Key.escape } }); // back into the shell - try std.testing.expectEqual(shell, p.active); - _ = test_api.ptyBytes(p, null, &buf); - - p.update(.{ .key = .{ .cp = Key.escape } }); // bare Escape leaves at a prompt - try std.testing.expectEqual(@as(usize, 0), p.active); - try std.testing.expectEqualStrings("", test_api.ptyBytes(p, null, &buf)); - try std.testing.expectEqual(Text.Mode.tty, pane.body.mode); -} - test "the Del question shows only once its delay is up: a quick SPC d j never sees it" { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 40 }); defer p.deinit(); diff --git a/src/macos.zig b/src/macos.zig index 13b8b332..17b1bf35 100644 --- a/src/macos.zig +++ b/src/macos.zig @@ -724,13 +724,6 @@ export fn pardes_window_opacity() u8 { return st.core.settings.window_opacity; } -/// Public AppKit backdrop strength, independent of background paint opacity. -export fn pardes_window_blur() u8 { - pardes.turn.wake(); - defer pardes.turn.rest(); - return if (state) |st| st.core.settings.window_blur else 0; -} - fn taglineFontPercent(core: ?*const pardes.Pardes) u8 { return if (core) |p| p.settings.font.tagline_percent else pardes.config.gui_tagline_font_percent; } @@ -2549,7 +2542,6 @@ test "pardes.h declares every export the way it is defined" { try expectSameAbi(@TypeOf(c.pardes_active_dirty), @TypeOf(pardes_active_dirty)); try expectSameAbi(@TypeOf(c.pardes_theme_bg), @TypeOf(pardes_theme_bg)); try expectSameAbi(@TypeOf(c.pardes_window_opacity), @TypeOf(pardes_window_opacity)); - try expectSameAbi(@TypeOf(c.pardes_window_blur), @TypeOf(pardes_window_blur)); } test "pardes.h matches the Zig boundary" { @@ -2868,20 +2860,3 @@ test "mac tag layer ABI preserves logical capacity and physical grip" { try std.testing.expectEqual(encodeCell(.{}).len, canonical[10].len); } -test "mac window blur builtin reaches the ABI without changing opacity" { - try std.testing.expectEqual(@as(u8, 0), pardes_window_blur()); - const gpa = std.testing.allocator; - const core = try pardes.Pardes.init(gpa, .{ .tty_only = true, .cols = 8, .rows = 3 }); - defer core.deinit(); - state = .{ .gpa = gpa, .threaded = undefined, .io = std.testing.io, .core = core, .runtime = .{}, .config_arena = .init(gpa), .prompt_rcs = .{} }; - defer { - state.?.config_arena.deinit(); - state = null; - } - try std.testing.expect(core.executeBuiltinLine(0, "WindowOpacity 71")); - for ([_][]const u8{ "WindowBlur 0", "WindowBlur 40", "WindowBlur 100", "WindowBlur 101", "WindowBlur 0" }, [_]u8{ 0, 40, 100, 100, 0 }) |command, expected| { - try std.testing.expect(core.executeBuiltinLine(0, command)); - try std.testing.expectEqual(expected, pardes_window_blur()); - try std.testing.expectEqual(@as(u8, 71), pardes_window_opacity()); - } -} diff --git a/src/macos/Sources/AppDelegate.swift b/src/macos/Sources/AppDelegate.swift index 3cce7592..dbc0fbc9 100644 --- a/src/macos/Sources/AppDelegate.swift +++ b/src/macos/Sources/AppDelegate.swift @@ -15,9 +15,6 @@ import AppKit final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate { private var window: NSWindow! private var view: PardesView! - /// The blur behind the grid, shown only while the theme declares no - /// background of its own. See applyTheme. - private var backdrop: NSVisualEffectView! // One display-clock chain at a time. Input and pty notifications may all // call pump(), but none advances animation; they only observe this flag and // leave the already-scheduled frame alone. @@ -78,31 +75,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate { // isReleasedWhenClosed on would have AppKit release it out from under // that reference the moment the close button is pressed. window.isReleasedWhenClosed = false - // The grid and the blur are SIBLINGS in a plain container, not parent - // and child. A transparent theme has to show something through the - // grid, and AppKit will not blur what is behind a window unless an - // NSVisualEffectView asks it to. The backdrop can be hidden independently - // when blur is disabled or the ground is opaque; hiding a superview hides - // its subviews with it. Nested, an opaque theme drew a blank window. let container = NSView(frame: NSRect(origin: .zero, size: want)) container.autoresizesSubviews = true - backdrop = NSVisualEffectView(frame: container.bounds) - // .underWindowBackground is the material meant for exactly this — the - // full-window wash behind content, rather than the sidebar/HUD - // materials that carry their own tint. .behindWindow is what samples - // the desktop instead of the window's own layers. - backdrop.material = .underWindowBackground - backdrop.blendingMode = .behindWindow - // .active, not .followsWindowActiveState: the grid stays readable when - // the window is not key, and a backdrop that flattens to grey on focus - // loss makes an unfocused pardes look switched off. - backdrop.state = .active - backdrop.autoresizingMask = [.width, .height] view.frame = container.bounds view.autoresizingMask = [.width, .height] - // Order matters: the blur is BEHIND the grid. - container.addSubview(backdrop) - container.addSubview(view, positioned: .above, relativeTo: backdrop) + container.addSubview(view) window.contentView = container // Trim the content box down to whole cells: a partial column or row is @@ -465,8 +442,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate { /// Dress the WINDOW in what the core is wearing: the background AppKit /// paints where the view does not (the titlebar, and the strip a live - /// resize outruns), and the blur behind a theme that brings no background - /// of its own. + /// resize outruns). /// /// Cheap enough to call every pump: the view compares before it dirties /// itself, and the window properties are written only when the answer @@ -474,7 +450,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate { /// theme whose background happened to equal the view's starting guess /// would otherwise leave the window in AppKit's default clothes forever. private var dressed = false - private var appliedBlur: UInt8 = 0 private func applyTheme() { // Both reads happen every pump, and neither may be short-circuited by @@ -483,16 +458,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate { // tick would leave one of them unworn. let themeChanged = view.adoptThemeBG(pardes_theme_bg()) let opacityChanged = view.adoptWindowOpacity(pardes_window_opacity()) - let blur = pardes_window_blur() - let blurChanged = blur != appliedBlur - guard themeChanged || opacityChanged || blurChanged || !dressed else { return } - appliedBlur = blur - backdrop.alphaValue = CGFloat(blur) / 100 - backdrop.isHidden = blur == 0 || (view.themeBG != nil && view.backgroundAlpha >= 1) + guard themeChanged || opacityChanged || !dressed else { return } dressed = true - // Opacity paints the theme ground; blur controls the native material - // behind it. An opaque ground hides the backdrop without losing the - // requested strength, so lowering opacity restores the effect. if let rgb = view.themeBG { window.isOpaque = view.backgroundAlpha >= 1 window.backgroundColor = view.backgroundAlpha < 1 ? .clear : NSColor( @@ -509,10 +476,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate { + 0.0722 * CGFloat(rgb & 0xFF)) / 255 window.appearance = NSAppearance(named: luma > 0.5 ? .aqua : .darkAqua) } else { - // Transparent: the window stops painting anything of its own and - // the optional blur sits behind it. isOpaque false lets the desktop - // reach the backdrop at all — a titled window is opaque by default - // and would composite over it. + // Transparent: the window stops painting anything of its own. + // isOpaque false lets the desktop show through at all — a titled + // window is opaque by default and would composite over it. window.isOpaque = false window.backgroundColor = .clear window.appearance = NSAppearance(named: .darkAqua) diff --git a/src/macos/pardes.h b/src/macos/pardes.h index 62ae5218..c4470569 100644 --- a/src/macos/pardes.h +++ b/src/macos/pardes.h @@ -266,8 +266,6 @@ uint32_t pardes_theme_bg(void); // Read it once per pump beside pardes_theme_bg(): reading also acknowledges // whatever `WindowOpacity` asked for. 100 is opaque and is the default. uint8_t pardes_window_opacity(void); -// Backdrop material strength, 0..100; zero disables blur. Not a pixel radius. -uint8_t pardes_window_blur(void); // Pane taglines use this percentage of the current body font size. It is the // embedded default before init and the live core setting afterwards; the host diff --git a/test/behaviour/modes.zig b/test/behaviour/modes.zig index ef39d912..e615920d 100644 --- a/test/behaviour/modes.zig +++ b/test/behaviour/modes.zig @@ -345,10 +345,9 @@ const Jumps = struct { } }; -test "modes: Ctrl-o keeps to the focused file (JumpScope file), A41 then A1, and leaves it only once it runs out that way; Ctrl-i mirrors it" { +test "modes: Ctrl-o keeps to the focused file, A41 then A1, and leaves it only once it runs out that way; Ctrl-i mirrors it" { var t = try Jumps.init("BABABA"); defer t.s.deinit(); - try std.testing.expect(std.mem.indexOf(u8, try t.s.read("/ctl"), "\nJumpScope file\n") != null); // B81, B41 passed over, kept in their places: A has nothing older than // A1, so the step after it is the nearest place of any file, B1. try std.testing.expectEqualStrings("A41 A1 B1", try t.walk(.key, true)); @@ -372,16 +371,6 @@ test "modes: Ctrl-i retraces a run of Ctrl-o inside one file step for step, back try std.testing.expectEqualStrings("A41 A1", try t.walk(.key, true)); } -test "modes: with JumpScope all, Ctrl-o and Ctrl-i take every place in the order it was jumped to, and bare JumpScope is file again" { - var t = try Jumps.init("ABABA"); - defer t.s.deinit(); - try t.s.write("/ctl", "JumpScope all\n"); - try std.testing.expectEqualStrings("B41 A41 B1 A1", try t.walk(.key, true)); - try std.testing.expectEqualStrings("B1 A41 B41 A81", try t.walk(.key, false)); - try t.s.write("/ctl", "JumpScope\n"); - try std.testing.expect(std.mem.indexOf(u8, try t.s.read("/ctl"), "\nJumpScope file\n") != null); -} - test "modes: from a pane with no file, Ctrl-o and Ctrl-i step through every place" { var t = try Jumps.init("OAOBO"); defer t.s.deinit(); diff --git a/test/behaviour/other_files.zig b/test/behaviour/other_files.zig index ae4c2928..bd8cbccd 100644 --- a/test/behaviour/other_files.zig +++ b/test/behaviour/other_files.zig @@ -150,7 +150,7 @@ test "other-files: Recent's row for a file still open is where its dot is now, n try std.testing.expect(has(rows, "\na.txt:2:3 open\n")); } -test "other-files: a closed file is found again: Recent and /recent list it closed, a look at its row reopens it at its dot, and a jump back does too" { +test "other-files: a closed file is found again: Recent and /recent list it closed, a look at its row reopens it at its dot, and a jump to it does too" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "a.txt", .data = "one\ntwo\nthree\n" }); @@ -181,13 +181,11 @@ test "other-files: a closed file is found again: Recent and /recent list it clos // to it opens it again. try s.write(s.at("/pane/{d}/ctl", .{back}), "Del\n"); try std.testing.expect(has(try listing(&s, "Jumplist"), "(closed)")); - // Every entry in order (JumpScope all): which file has the focus after - // a Del is the layout's to choose, and Back keeps to it first. - try s.write("/ctl", "JumpScope all\n"); - for (0..8) |_| { - if ((try named(&s, "/a.txt")).len > 0) break; - try s.write("/exec", "Back\n"); - } + // The text pane closed too, the keyboard is the +Jumps listing's, + // which has no file to keep to: Back takes the nearest place, the + // closed a.txt's. + try s.write(s.at("/pane/{d}/ctl", .{(try named(&s, "/test.txt"))[0]}), "Del\n"); + try s.write("/exec", "Back\n"); try s.expect(s.at("/pane/{d}/name", .{try s.focused()}), s.at("{s}\n", .{a})); } diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig index 113a423b..25a3bc04 100644 --- a/test/behaviour/settings.zig +++ b/test/behaviour/settings.zig @@ -123,7 +123,7 @@ test "settings: a setting this frontend cannot show says GUI-only, never run as try std.testing.expect(has(try s.read("/ctl"), "\nDumpDir /")); } -test "settings: Back and Forward written to exec keep to the focused file, and JumpScope all, written to ctl, takes every place in order" { +test "settings: Back and Forward written to exec keep to the focused file" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "a.txt", .data = std.mem.asBytes(&@as([100][4]u8, @splat("row\n".*))) }); @@ -156,13 +156,6 @@ test "settings: Back and Forward written to exec keep to the focused file, and J .{ "Forward", "/b.txt", 80 }, .{ "Forward", "/a.txt", 80 }, }); - try s.write("/ctl", "JumpScope all\n"); - try std.testing.expect(has(try s.read("/ctl"), "JumpScope all\n")); - try walk(&s, &.{ - .{ "Back", "/b.txt", 80 }, - .{ "Back", "/a.txt", 40 }, - .{ "Forward", "/b.txt", 80 }, - }); } const syntax = @import("pardes_config").syntax_highlighting; diff --git a/test/pdf.zig b/test/pdf.zig index 1b2f2829..da1cb45d 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -2197,7 +2197,7 @@ test "a PDF's jumps: Back after a far jump returns to the exact offset, two plac try std.testing.expectEqual(n, p.jumps.n); } -test "a PDF's jumps: JumpScope file keeps to the PDF, and a closed PDF reopens at its place" { +test "a PDF's jumps keep to the PDF, and a closed PDF reopens at its place" { if (!pdf_enabled) return error.SkipZigTest; // Recent keeps a file by the path it was opened as: a real one here, // as a Look opens one. @@ -2208,7 +2208,6 @@ test "a PDF's jumps: JumpScope file keeps to the PDF, and a closed PDF reopens a const p = try Pardes.init(std.testing.allocator, .{ .file = path, .cols = 80, .rows = 28 }); defer p.deinit(); p.frontend.native_images = true; - try std.testing.expectEqual(config.Runtime.JumpScope.file, p.settings.jump_scope); const doc = p.active; const pane = p.panes[doc].?; try jumpFrame(p); |
