Changelog
Every release, newest first. Download the latest.
0.0.47
Added
syntax/editor: Zig support for.zigand.zonfiles. Highlights keywords, arbitrary-width integer types, builtin calls, quoted identifiers, numeric literals, doc comments, and\\multiline-string lines. Both extensions support//comment toggling, virtual indentation, folding, bracket matching, file-tree icons, and desktop file associations. Brackets and comment markers inside Zig strings do not affect code structure or completion context.lsp:.zigfiles use ZLS. Install compatible Zig and ZLS versions onPATH, then use:lsp on; the existinglsp server zig <cmd> [args…]override selects a custom server command..zonfiles share Zig highlighting and editing behavior without automatically starting a language server.
0.0.46
Added
update::checkupdatechecks for a newer release now and says either way ("editor X is the newest version", or why it could not), also with:set noupdatecheck.
Changed
update: the check runs at start-up and every hour while the editor is open, instead of at most once a day and only at start-up, so a release shows up within an hour of being out. A failed check is tried again at the next one.update: a newer release stays in view until you run it. The status bar showsX availablebeforerow:col, and:versionnames it, in every window and after a restart. The notice appears once per release, not once per window.~/.editor.updatenow keeps the last answer as JSON; the old timestamp-only file is still read.
0.0.45
Added
macos: File ▸ New Window (Shift+Cmd+N) and New Window in the Dock menu. Finder, Spotlight and the Dock reuse the running Editor, so the only way to a second window waseditorfrom a shell. Each window is its own Editor process, and New Window starts another one from the sameEditor.app. A baremacos/editorbinary has no bundle to relaunch and says so in the status line.site: editor.pawsm.com has a real 404,robots.txt,sitemap.xml, Open Graph and JSON-LD metadata, and WebP screenshots. Unknown paths used to answer with the landing page and a 200./app/isnoindex.make sitenow needscwebp(brew install webp,apt install webp).
Fixed
web::grepfinds matches witheditor-daemonon macOS. It said "no matches" for every pattern: BSD grep matches--exclude-dir=.?*against whole paths, so every directory was skipped, and reads-Zas--decompress. It now passes--exclude-dir=.[!/]*and--null, which GNU grep reads the same way. Native builds use the in-process grep and were unaffected.
0.0.44
Fixed
gfx: CoreText strings keep a leading byte-order mark. The macOS backend built them withCFStringCreateWithBytes, which drops a leading U+FEFF, while span and caret offsets still counted it. A syntax span reaching the end of a line that starts with a BOM then ran past the string, and CoreFoundation read garbage memory: editgit crashed showing the first line of a file saved with a BOM. The text is now encoded to UTF-16 in the backend, so the BOM is kept, invalid UTF-8 becomes U+FFFD instead of a NULL string (which also crashed), carets on such lines are no longer one character off, and spans are clamped to the string.make testruns the newplatform/gfxtests on macOS too.macos: the first line of a file saved with a BOM is coloured and edited at the right columns. Row strings were built withinitWithBytes, which drops a leading U+FEFF, while the syntax, caret and hit-test offsets still counted it: on that line colours were one character off, and the cursor, selection and clicks landed one glyph away. The frontend now encodes the UTF-16 itself, which also replaces its invalid-UTF-8 rewrite pass; the render regression cases are pixel-identical.
0.0.43
Changed
update::updateis now:download. In Vim,:updatewrites the buffer if it changed; typed from habit here, it opened the download page and left the buffer unsaved.:downloadopens the download page, and the new-release notice and:versionname it.
0.0.42
Added
update: the native builds say when a new release is out. Once a day, at most, the editor fetcheshttps://editor.pawsm.com/latest.jsonwithcurland, when it names a newer version, showseditor X is available. :update opens the download page.:updateopens that page,:versionshows the running version (and a newer one, if known), and:set noupdatecheckturns the check off (!saves it to~/.editor). The last check's time is kept in~/.editor.update. Local builds (dev) and the browser build never check.ci/site: release builds carry their tag as the version (make VERSION=X.Y.Z, defaultdev), andmake sitewriteslatest.jsonfor the check.
0.0.41
Added
chat: steer a running turn.:send(orCtrl+Enter) while Claude is still thinking or running tools sends your message into the turn instead of being refused: the agent reads it at its next step, or answers it right after the turn if the turn ends first. The message stays in the transcript where you typed it, and the reply continues below it./commandswait for the turn to end; Codex and Gemini cannot be steered.chat::sendanswers what Claude is waiting on. With a question pending, what you typed is the answer; with a tool request or a plan pending, it is the reason the request is denied (as:deny <reason>), so the agent reads why and carries on.:allowand:answerwork as before.chat: autoscroll can be turned off.:set nochatscroll/:set chatscroll(with!saved to~/.editor), or the bindableChatScrollToggle(no default key), applies to all chat panes; on by default.
Changed
chat: the reply streams in above your next message. While a turn runs, the transcript ends in an empty### Userblock; type your next message there while the agent works. The reply goes in above it, so nothing you type mixes into the agent's text, and your cursor, a visual selection, extra cursors and marks in that block move down with it. The### Assistantheading appears with the reply's first output. Codex and Gemini get the same layout.chat: the view follows a streaming reply while your cursor is in that bottom block and on screen. Move the cursor up into the transcript, or scroll it out of view with the wheel, and the view stays put while you read;Gfollows again. (0.0.40 followed only from the last line.)
Fixed
chat: the agent's reply sometimes showed up as the user's message. Claude Code starts turns on its own — when a background command or subagent it started finishes, or to answer a message queued during the last turn — and the editor, thinking the agent idle, appended that reply under the### Userheading, after anything you were typing there, then added a second### User. Such a turn now opens its own### Assistantheading above your block, runs the spinner and can be stopped with:stop. A background subagent's permission request between turns shows the same way and can be answered without a turn running. Output arriving after an interrupted turn has already ended no longer leaves the pane spinning forever.chat: the reason a:sendduring a turn did nothing ("/commands wait for the turn to end", "E: empty chat", …) was overwritten by the spinner within 80 ms; it now stays for about 2 s.:set chatscrolland its variants are in:Tab completion.terminal::runno longer breaks the terminal undereditor -t.flutter devices --machinewas spawned with the TUI's raw tty as stdin, and flutter's exit hook turned line mode and echo back on, so the terminal echoed every mouse and focus report over the screen and keys reached the editor only after Enter.flutter devices, macOSwhich flutter, Linuxxdg-open(DevTools) and the:assocdatabase refresh now get/dev/nullon stdin.
0.0.40
Added
chat: plan mode, effort and model switching.:chat-model,:chat-effortand:chat-modeset what a chat pane runs with, per pane and mid-conversation; typed with a trailing space each opens a picker (the model list is the one your account offers).:chat-plantoggles plan mode: the plan arrives under#### Planand is approved with:allowor sent back with:deny <feedback>.set chat_effort,set chat_modeandset chat_thinkingin~/.editorset the defaults. Between turns the status line shows model, mode, effort, context use and cost.chat: the agent's own/commands./at the start of a message lists the editor's commands (/clear,/model,/effort,/mode,/plan,/help) and then Claude Code's — built-ins, custom commands, skills. Anything that is not the editor's is sent to the agent.chat: thinking is shown, folded. Claude's thinking streams in as a quoted block under> [thinking]and collapses to that one line when it ends;zaopens it.set chat_thinking openleaves the blocks open.project::project close, and:project loadswitches projects. After:cdinto another tree,:project loadloads the.editor.prjfound there, saving the current project first (the same project is reloaded from disk); it used to answer "already loaded".:project closesaves the project and closes it, leaving one empty pane and none of its breakpoints, watches, marks or run settings. Both refuse while a buffer has unsaved changes (!discards them) or a debug session runs.:cdout of a loaded project now says the project is still loaded.syntax: fenced code in Markdown is highlighted in its language (```odin,~~~py, …), in.mdfiles and in the chat pane. The chat transcript's own lines — role headings, tool lines, permission prompts, banners — take theme colours too. A Markdown blockquote of two or more lines is a fold region.
Changed
chat: one Claude session per chat pane.:sendused to start a newclaudeand replay the whole buffer every time; the agent now runs for as long as the pane is open, is sent only each new message, and resumes its session (claude --resume) if the process dies. The buffer is therefore a transcript: editing an earlier turn no longer changes what the agent remembers (/clearstarts over), and editor chats appear in Claude Code's session history.:stopinterrupts the turn and keeps the conversation. Needs a recent Claude Code (built against 2.1.322). Codex and Gemini are unchanged: one process per:send, given the whole buffer.chat: approvals come from Claude Code itself, over the agent's own pipes (--permission-prompt-tool stdio), not through the PreToolUse hook andeditor-perm-helper. Claude's rules decide what needs asking, so anything allowed in your Claude Code settings no longer prompts in the editor; requests for parallel calls are prompted one at a time, and:denytakes a reason.editor-perm-helperis still shipped but unused by the built-in agents.chat: while a reply streams, the view follows only if the cursor was on the last line; scroll back to read and it stays put.Ctrl+Enterand the chat-only:commands also work in a saved*.chat.md.
Fixed
project::project loadover an open session closed every other pane without asking, unsaved buffers included; it now refuses on unsaved changes. A breakpoint the old session shared with the loaded project, or one saved twice in.editor.prj, was toggled off by the load: saved breakpoints are now added, never toggled. Run from a focused floating pane ([chat],[! cmd]), the load put the first saved file into that pane.:project deleteprinted the deleted path from freed memory.syntax: Markdown lost its place on ordinary text. An unclosed`or*coloured everything after it — a blank line did not end the run — a fence indented four spaces or more was not seen, a line ending in```closed a code block from inside it, and an unmatched[hid the rest of its line.linux/windows/web/terminal: the line after a closed fold could be coloured with the wrong lexer state (the fold's first line's, not its last line's).chat: a streamed reply re-lexed the whole transcript on every chunk; an agent that died with only an error on stderr left[no response]with no reason — the banner now carries the agent's last line.
0.0.39
Added
macos/ci/site: the macOS download is a disk image.editor-macos-arm64.dmgholdsEditor.appbeside an Applications shortcut: open it and drag. Newmake dmg-macbuilds it withhdiutilfrom the bundle as it stands, without rebuilding it, because the release job signsEditor.appaftermake release-macand a rebuild would re-sign it adhoc. The release job builds the image from the notarized, stapled app, signs it with the Developer ID, and notarizes and staples the image as well, so both it and an app dragged out of it pass Gatekeeper offline. The landing page offers the image;editor-macos-arm64.zipis still attached to each release.
0.0.38
Changed
ci/windows/site: the Windows download is code-signed.editor.exe,editor.comandeditor-perm-helper.exeare signed through Azure Artifact Signing (publisherPAWSM.doo, RFC 3161 timestamp), now that the credentials the 0.0.36 signing step waits for are set; the release job fails if any of the three does not verify. The landing page's Windows card says so. SmartScreen may still warn while the signature is new.
0.0.37
Fixed
editor/windows::dbg-testworks with Windows paths. Its paths were cleaned with Windows separators (\, and/x/ylost its root) while project files are listed asroot/rel, so on Windows:dbg-test list alldid not sort the current file's tests first,:dbg-test listdid not preselect the last test run, and picker payloads mixed\and/. Test paths are now kept with/separators on every platform — the form the Windows frontend uses — including drive letters and UNC (//server/share) paths. The Windows CI test job, failing on these since October, passes again.
Changed
build/ci: the Lua source tarball is downloaded once into.deps/, whichmake cleankeeps, so a release build no longer downloads it twice; CI restores.deps/from its cache, becausewww.lua.orgoften does not answer GitHub's runners.
0.0.36
Added
daemon/ci: the Linux and macOS downloads includeeditor-daemon, the bridge that lets the browser editor (editor.pawsm.com, oreditor-daemon --site) work on a real project. Linux tarballs ship it besideeditor; on macOS it isEditor.app/Contents/MacOS/editor-daemon, signed and notarized with the app, beside theeditor-perm-helperit uses for AI chat.make release-linuxnow builds it, andmake bundle-macputs it in the bundle.site: the download cards say what each build needs (Linux: glibc 2.38 or newer, pluslibxcb-imdkit1/libxcb-util1on Debian and Ubuntu), how to run each one in a terminal, and whereeditor-daemonis; a features card for terminal mode.
Fixed
site: the landing page no longer sends Safari users to the daemon's ownhttp://127.0.0.1page, which a downloaded daemon cannot serve, and no longer claims an OpenGL ES renderer for Linux, which does not draw the live window yet.
Changed
ci: release builds can be notarized (macOS) and code-signed (Windows). The macOS job submits the Developer ID-signedEditor.appto Apple's notary service and staples the ticket once an App Store Connect API key is set (APPLE_NOTARY_KEY_ID,APPLE_NOTARY_ISSUER_ID,APPLE_NOTARY_KEY_P8). The Windows job signseditor.exe,editor.comandeditor-perm-helper.exethrough Azure Artifact Signing once its credentials are set (secretsAZURE_TENANT_ID,AZURE_CLIENT_ID,AZURE_CLIENT_SECRET; variablesAZURE_SIGNING_ENDPOINT,AZURE_SIGNING_ACCOUNT,AZURE_SIGNING_PROFILE). Without them both steps skip and the builds ship as before.ci/windows: the Windows release zip now includeseditor.com, the console twineditor -tandeditor --mcp-stdioneed.macos: the macOS frontend builds with Odindev-2026-11and later, which moved the AppKit types (NSEvent,NSWindow,NSView, …) out ofcore:sys/darwin/Foundation.macos/importsNSfromvendor:darwin/AppKit(AppKit plus Foundation's types), and Foundation itself asNSFfor the procs that package does not re-export (Bundle_mainBundle,String_UTF8String, blocks). Removed*_allochelpers becameallocmessage sends; the Objective-C runtime calls come fromcore:sys/darwin/ObjectiveC;CTLineGetBoundsWithOptionsanddispatch_resumeuse the declarationscore:sys/darwinnow ships, since a second local one with another signature is a redeclaration error. Older Odin releases can no longer buildmacos/. The release build's temporary pin todev-2026-10is gone.
0.0.35
Added
mcp/linux/macos/windows: an MCP server — AI agents can see and drive the running editor. Every native editor, window or-t, listens on127.0.0.1behind a random token. Agents read what you have open (unsaved edits included), your selection and LSP diagnostics; they open files and propose changes; they save, edit buffers and run:commands.:mcpshows where it listens,:set nomcpturns it off (:set! nomcpfor good).- Three ways in.
:chatwith claude is wired automatically (--mcp-confignaming${EDITOR_MCP_URL}/${EDITOR_MCP_TOKEN}, so the token never appears in argv); the tools that only read or show things skip the permission prompt, while save, edit and command still ask.claudein a terminal connects with/ide— the editor writes~/.claude/ide/<port>.locklike the IDE extensions do, so Claude follows your selection, checks diagnostics after its edits and shows them as proposals;:mentionputs the selection into its prompt. Any other MCP client (Claude Desktop, codex, gemini) runseditor --mcp-stdio, which finds the running editor for its directory; Streamable HTTP clients can usehttp://127.0.0.1:<port>/mcpdirectly. - Proposals.
openDiffopens a[proposal] <file>tab as an inline diff against the file as you have it; you may edit it, then:acceptapplies it as one undo step and saves,:reject(or closing the tab) says no — the agent waits for the answer either way. - Tools:
getOpenEditors,getCurrentSelection/getLatestSelection,getDiagnostics,getWorkspaceFolders,checkDocumentDirty,readBuffer,openFile,openDiff,close_tab,closeAllDiffTabs,saveDocument,editBuffer,runCommand. Names and replies follow Claude Code's IDE protocol. - Locked down: loopback only, an exact
Hostcheck, anyOriginheader refused (no browser page can reach it), the token in headers only and stored in user-only files removed at exit. CLAUDE.md lists the invariants. - New:
core/mcp(protocol and tools, wasm-clean),core/mcpserver(WebSocket + HTTP transport, discovery files, the stdio shim),core/netproto(the RFC 6455 codec and HTTP head parsing, moved out of the daemon, which aliases them unchanged), and amcp_host.odinper frontend. Tests:core/mcpandcore/mcpserversuites, MCP steps inmake smoke-tui. Linux is tested end to end; macOS and Windows typecheck.
- Three ways in.
syntax/lsp: Kotlin. Highlighting for.kt/.kts, thekotlin-lspserver, comment toggling, smart indentation and file associations.syntax/lsp: assembly..s/.S(GNU as,#comments) and.asm/.nasm(;comments) — two languages because;separates statements in GAS. The first word of a statement highlights as its mnemonic whatever the ISA;asm-lspas the server, plus comment toggling, a file-tree tint and file associations.web/daemon: a browser frontend built from the shared Odin core, with a companion daemon for real files and programs.make webbuilds the WebAssembly editor, drawn on a canvas; standalone files, settings and crash-recovery swaps persist in the browser's private storage.:open, Ctrl+O and file drops import files, and:exportdownloads the focused buffer. Withmake daemonandeditor-daemonrunning in a project, the browser gains the machine's filesystem, language servers, git gutter,:!,:grep, native debugging, Flutter/Dart runs and debugging, and AI chat with permission prompts and inline suggestions. Panes, tabs, floats, the file tree, completion and mouse interaction work in the browser too. Lua and native plugins remain desktop-only.web/daemon: hosted browser editor and remote access through Cloudflare Tunnel. The site ateditor.pawsm.comserves the editor under/app/;editor-daemon --siteconnects it to a local project, and--site-urlsupports another hosted copy.--tunnelstarts a quick tunnel throughcloudflared;--tunnel-host <host> --tunnel-creds <file>uses a named tunnel. Tunnel access uses a separate token, reports new remote addresses and connections, and ends when the daemon stops. The daemon's/vmrelay lets Dart and Flutter debugging work from hosted pages, tunnels and SSH forwarding without exposing the VM service directly. DevTools' own UI still runs on the daemon's machine. New build and validation targets includemake site,serve-site,deploy-site,smoke-siteandsmoke-web.flutter/debug: open Dart and Flutter DevTools and jump from the widget inspector to source.:run devtools, ordin the run output pane, opens DevTools for the running app. Flutter starts the DevTools server through its daemon; plain Dart uses the URL printed by the VM. Selecting a widget in the inspector, or using the app's Select Widget Mode, moves the editor cursor to its creation location without raising the editor window.tui/linux/macos/windows: terminal mode —editor -t [file …]runs the editor inside the terminal, over ssh, in tmux, or on a machine with no display. It is the whole editor, not a subset: panes, tabs, floats, the file tree, completion / hover / palette floats, LSP, the debugger panes,:run, chat,:!, Lua and plugins, with the window's own key path behind it. On Linux it also starts by itself when neitherWAYLAND_DISPLAYnorDISPLAYis set and a terminal is attached; on macOS in an ssh session.- One shared package,
tui/, imported by all three frontends — the drawing is written once, not three times. It holds a cell screen that diffs each frame against the last and emits only changed cells (24-bit SGR, or the nearest of 256; synchronized output; the terminal's own cursor as the caret, a block or a bar), a pure VT input decoder that folds keys into exactly the compositeed.Keys the GUI keymaps produce (legacy control bytes, CSI/SS3 with xterm modifiers, the kitty keyboard protocol, xterm modifyOtherKeys, SGR mouse, bracketed paste, focus reports), a paint walk in cells modelled on the browser build's, and cell hit-testing for the mouse. Widths come fromcore/wrap's table (now exported aswrap.rune_width), the same one the wrap math uses, so the screen and the row plan agree on every wide glyph. - Core needed two changes, both additive.
panetree.set_cell_units()switches the float minimum size, grab band and drag slop from pixels to cells (they are now variables with the old pixel defaults), andfiletree.cell_metrics()lays the tree out in whole cells. A cell is the "pixel" everywhere else, socompute_layout,editor_pixel_y_to_rowsub,editor_set_cursor_pixelandhscroll_pxwork unchanged. - Per platform. Linux runs its usual
poll()loop on fd 0 beside the eventfd, with a SIGWINCH self-pipe. macOS runs noNSApplicationat all: the bootstrap isapp_start, andCFRunLoopRunInModedrains the main dispatch queue (where every reader thread posts) and fires the file-watch timer, with fd 0 and SIGWINCH as dispatch sources. Windows getseditor.com, a console-subsystem twin ofeditor.exebuilt from the same sources —PATHEXTfinds it first, soeditor -tin a terminal runs it, and without-tit startseditor.exeand returns as before; subprocess posts and timers go to a message-only window throughapp_message, now shared with the real window's procedure, and the ~80 directInvalidateRectcalls go throughrequest_repaint. Teardown is oneapp_teardownper frontend, shared by both loops. - Terminal behaviour. Ctrl+Z suspends (
fgresumes); Ctrl+C is Esc; unbound Ctrl+letters do nothing instead of typing the letter. Yanks also go out as OSC 52 when the editor has no clipboard on the terminal's machine (Linux without a display, any ssh session); Ctrl+V pastes the native clipboard where there is one, else the last yank; the terminal's own paste arrives as a bracketed paste. Diagnostics are underlines (curly where the terminal supports it), floats get a box-drawing frame. Closing the terminal (SIGHUP, SIGTERM; on Windows the console's close / logoff / shutdown events) ends the loop the way:qdoes — the project session is saved and every child shut down — instead of dying in the crash handler. The mouse reports every move (mode 1003), so the file tree's hover highlight works, and a move repaints only when something actually changed. The crash handlers restore the terminal before anything else, and stderr goes to~/.editor.login terminal mode even from a tty. - Tests:
make test-tui(decoder, width model, screen diff/wide glyphs/fills; inmake test) andmake smoke-tui, which driveslinux/editor -tin a detached tmux — drawing, editing and:w, a mouse click,:vsplit, Tab completion, the palette, a resize, a clangd diagnostic, and the tty modes restored on exit. macOS and Windows are typechecked from Linux; neither has been run.
- One shared package,
editor/linux/macos/windows::pane <family> fontsize|bg|fg— each floating utility-pane family gets its own text size and colours. The four families areresults([grep],[search results],[diagnostics],[references],[symbols],[breakpoints],[marks],[diff],[space menu]),chat([chat]),proc([! cmd],[flutter run],[dart run],[flutter devices]) anddebug([debug],[value]).:panelists every override,:pane <family>one family's,:pane <family> fontsize <n>sizes it this session (reset/0follows:fontsizeagain),:pane <family> bg <#hex>/fg <#hex>recolour it (#rrggbb[aa]or#rgb[a];resetfollows the theme), and the bang forms persist to~/.editoraspane <family> <prop> <value>lines.fgreplaces the theme's plain-text colour only, so Markdown headings and code in[chat]and the dimmedpath:line:prefixes of result rows keep their theme colours, and the overrides survive a:themeswitch. Clicks, selection and scrolling in a resized pane use its own metrics.:debugfontsize[!] [<n>]stays as the older spelling of:pane debug fontsize, and:pane! debug <prop>replaces a legacypane dbg/debugfontsizeconfig line. The renderers on all three platforms now take the font metrics per pane rather than from one global, which is what the per-family size rides on; the Linux render check gained a fixture withpaneoverrides so the per-pane metrics are pinned. New:core/editor/pane_style.odinwith its tests, plus config and float-family tests.editor: a[memory]dump for the debugger — raw bytes at an address expression, as hex or as bits.:mem <expr> [<count>](ormon a Variables / Watches row) opens a centered[memory]float:address 16 bytes |ASCII|rows,bswitches to a binary view of 8 bytes per row,]/[page by<count>from the resolved address,:mem hex/:mem binpick the view, and a bare:memre-reads. The dump is live — every stop re-reads it while it is showing, a frame switch re-resolves the expression — and it closes with the session. What<expr>means follows the debugger's ownmemory read: a literal is the address, a pointer or an array is read at its value, anything else at its own address; an Odinstringor slice reads itsdatarather than the fat-pointer header the user never wanted. The Dart VM debugger has no memory access and says so.- Two wire shapes, gated on what the adapter advertises — and the gate is not optional. DAP
readMemoryis used only when the initialize response carriessupportsReadMemoryRequest(lldb-dap 20+, codelldb). The lldb-dap 18 this machine runs does not, and sendingreadMemoryanyway crashes it outright; for those adapters the editor runs lldb's ownmemory read --format ythroughevaluatein the console context (backtick command escape) and parses the text back, including the echoed command line, unpadded addresses and theerror: memory read failedthat arrives as a successful reply. Address resolution is a plaincontext:"watch"evaluate, which lldb-dap never treats as a command. The client also now sendssupportsMemoryReferences, so adapters that can attach amemoryReferenceto a value short-circuit the guess. - New:
core/debug/memview.odin(formatter, lldb text parser, the pane),mem_requestandEvent_MemResultincore/debug/client.odin, float roleDbgMemory, picker kindDbgMemory, actionsDbgMemView/DbgMemSetMode/DbgMemPage/DbgMemViewRow, remappable commandsDbgMemToggleMode/DbgMemPageNext/DbgMemPagePrev/DbgMemViewRow. 12 tests fake both wire shapes;memview_live_test_linux.odinbuilds a small Odin debuggee and drives the client's own bytes through a real lldb-dap, which is what proved the fallback (it passes with a note where no adapter is onPATH).
- Two wire shapes, gated on what the adapter advertises — and the gate is not optional. DAP
Changed
editor/lsp/project: one test for a buffer name that is not a file (editor_is_virtual_name), shared by swap files, LSP, project sessions and MCP. Project sessions no longer save a bracketed buffer such as[proposal] <file>as a file to reopen.daemon:netprotoholds the WebSocket and HTTP parsing the daemon and the MCP server share; no behaviour change. Dev dependencies:wrangler4.156.0,undici7.30.1.ci/linux: Linux release workflows now install the EGL, OpenGL ES and FreeType development dependencies required by the GPU renderer.
Fixed
files/editor: Ctrl+P no longer freezes the editor outside a project. Without a project marker the file walk starts at the working directory — often$HOME, which once held the UI for over a minute. The walk the picker waits for is now capped at a second: past that it shows what it found and says the list is incomplete, and later opens keep walking a warmer directory cache until one finishes. Directory listing reads entry types without opening or stating each file.syntax/editor: completion no longer fires inside comments in Python, Lua, Ada, YAML, HTML or assembly, and Odin, Swift, Rust and Kotlin nested block comments are tracked past their first close.windows/macos::!output trimming no longer callslibc.memmove, which the current Odin compiler can link as an unresolvedmemmove.1.tui: the editor's terminal cursor no longer shows through floating:grepand results panes. Opaque surfaces hide a covered cursor; a focused pane can place its own cursor, while an uncovered editor cursor stays visible. Regression tests cover results-pane rendering, clipping, translucent highlights and terminal cursor visibility.filetree: long file lists can be scrolled to the end without snapping back to the selected row. Redrawing preserves mouse-wheel scrolling even when the selection is off screen; keyboard navigation still reveals the selection. Resize detection uses the last painted content height rather than the cursor's visible-line count, which key handling can overwrite before paint. macOS keyboard navigation now excludes the pinned header from that count. Regression coverage checks wheel scrolling in both directions, navigation through the bottom edge and resizing after an input update.editor/linux/macos/windows: pasting into:commands or/searches inserts at the caret instead of modifying the underlying buffer. Clipboard, context-menu and host text input share one mode-aware dispatcher; the command picker refreshes after a paste. Command-line typing, movement, Backspace, Delete, completion and fixed-buffer truncation now respect UTF-8 character boundaries, so non-ASCII paths and search terms stay intact.macos/buffer: malformed UTF-8 no longer crashes the macOS renderer or makes horizontal motions skip valid characters beside it. Rendering substitutes a replacement glyph for each invalid byte, with text measurement and byte-to-UTF-16 mapping kept in step;handltreat malformed bytes as individual characters.editor/linux/macos/windows: closing a pane clears cached layout and mouse references before another input event can use the freed editor. Delayed inline-AI requests and replies also check the editor's lifetime identity, so a new pane allocated at the same address cannot receive an old pane's suggestion.web/daemon: an unreachable daemon is no longer mistaken for a missing file. Failed reads preserve the current buffer instead of opening an empty replacement, and configuration and session loading distinguish connection failures from absent files. Background swap writes are queued without blocking typing, retained across disconnects and retried on reconnect; failures are reported. Batched filesystem probes and daemon-side project walks reduce round trips over remote connections.debug/filetree: corrected the relaunch and reload icons in the debugger and file-tree panes.
0.0.34
Added
windows: a D3D11 GPU renderer and an HLSL post-processing shader, so:set gpuand:set shaderare real on Windows. The settings, their!persisting variants and their tests have been incore/editorsince the macOS renderer landed; the Windows frontend simply ignored them. It now presents through a DXGI flip swap chain, builds frames as one ordered instance stream out of a DirectWrite glyph atlas, and applies the same colour-grade / grayscale effect the Metal path applies. Linux still has no GPU path and continues to ignore both settings.- The frame is recorded before it is drawn.
windows/draw.odin's 2340-line paint walk no longer calls Direct2D: it records into aPainterdisplay list (windows/paint.odin) that a backend replays — Direct2D (windows/paint_d2d.odin) or the D3D11 instance pass. That seam is what makes the GPU path an additional consumer of one renderer rather than a second copy of it. It landed byte-identical: all three render-check cases (a staged frame with an autocomplete float and its wrapped documentation panel, diagnostics of every severity, extra cursors and ghost text; a two-tab frame; a vertical split with nested clips) match their pre-seam references on 0 of 1,191,624 pixels. - Text ownership was the design problem, and the answer deleted work. macOS text commands own a +1 reference to an
NSAttributedString; Windows' text primitive is a byte string, so commands intern UTF-16 into a per-frame arena instead. Keeping the UTF-8 slice and converting at replay was considered and is unsafe concretely — the pointers handed todraw_utf8_textfrom the row walk are offsets into a line buffer the walk frees as soon as the logical line changes, and several other call sites pass stack buffers. Interning also removes themalloc+MultiByteToWideChar+freethat ran on every text command of every frame, and the per-commandCreateSolidColorBrush/Releasepair with it: a "brush" is now a colour handle, and the replay keeps one device brush and callsSetColor. Direct2D takes the brush as an explicit argument, so the "never cache a colour" rule the Core Graphics backend documents at length does not apply here. - Shaped glyphs come from
IDWriteTextLayout::Draw, through anIDWriteTextRendererimplemented in Odin — the first COM interface this codebase implements rather than calls. DrivingIDWriteTextAnalyzerinstead would have meant reimplementing script itemisation, bidi, font fallback and the OpenType feature list by hand, and every reimplementation is a place the GPU frame silently diverges from the Direct2D one. Using the same layout object means the same glyphs; only rasterisation changes. Two rules were found by crashing:QueryInterfacemust be strict, becauseDrawprobes forIDWriteTextRenderer1and claiming it makes DirectWrite index vtable slots past the end of ours; andIsPixelSnappingDisabledmust return TRUE, or DirectWrite rounds each run's baseline to a whole pixel and destroys the subpixel phases. Font fallback needs no special handling — a fallback run arrives as its ownDrawGlyphRunagainst a different face — but the face pointer is borrowed for the callback only, the DirectWrite analogue of "a CTLine owns the fonts of its runs", so it is interned with anAddRef. - Coverage comes from
IDWriteFactory2::CreateGlyphRunAnalysiswithGRAYSCALEantialiasing andNATURAL_SYMMETRIC+ grid-fitting disabled. Both of the latter are load-bearing: with hinting or grid fitting on, DirectWrite quantises the outline to whole pixels, all four subpixel phases rasterise identically, and glyph spacing goes uneven — the exact artefact phases exist to prevent. Slots are sized per glyph rather than per font, becauseGetAlphaTextureBoundsgives the exact ink box for free; the macOS path sizes from font metrics only because its per-glyph ink query returns aCGRectthat faults across Odin's ABI boundary. Bearings need no flip, andIDWriteFactory2being unavailable (pre-Windows 8.1) latches the GPU path off rather than falling back to a binary mask, which would look visibly wrong. - One placement bug worth recording, because the harness is what found it and the aggregate number hid it. Rounding the layout origin instead of the baseline drew some rows a whole pixel low while their neighbours were fine — the baseline sits a fractional distance below the origin, so whether a row crossed a pixel boundary depended on its fraction. It moved the overall GPU-vs-Direct2D difference from 1.52% to 1.45% of pixels, which is nothing; what showed it was a row-by-row histogram where a handful of rows differed by an entire glyph height while the rest differed by antialiasing.
- What it costs, stated plainly. The two renderers cannot match byte for byte, so
make render-check-windowsdrives Direct2D deliberately and the GPU path has its own comparison under a budget. On the staged frame they differ visibly on ~2% of pixels: mostly glyph edges (91% of differing pixels differ by ≤63/255), plus thin fills — Direct2D antialiases a sub-pixel-height rectangle into a faint line where a hard-edged GPU quad covers no pixel centre at all. The D3D11 path also allocates a frame-sized BGRA scene texture and a 4 MB glyph atlas. There is no damage tracking yet: Windows repaints whole windows, so the GPU pass redraws the whole frame each time — still cheaper than the full-window Direct2D repaint it replaces, but it does not collect the win the macOS damage system collects.D3D_Frame_Buildalready carries the damage array and the encoder already scissors per rect, so feeding itps.rcPaintlater needs no change to either file. - Text antialiasing changed on the Direct2D path too, from ClearType to grayscale (
SetTextAntialiasMode). The GPU atlas stores grayscale coverage and has no equivalent of subpixel triples, so without this the two renderers could not be compared at all, let alone match. This changes existing pixels on Windows. - New:
windows/{paint,paint_d2d,d3d_present,d3d_frame,d3d_text,glyph_atlas,glyph_extract,dwrite_glyph,render_snapshot}.odin,core/render/(damage geometry and BGRA comparison, moved out ofmacos/render_benchmark.odinandmacos/metal_postprocess.odinso both frontends share one tested copy),tests/render/{win,gpu-win}.sh, andmake render-baseline-windows/render-check-windows/render-gpu-windows/test-windows. 34 new tests acrosscore/renderandwindows, none of which need a GPU.
- The frame is recorded before it is drawn.
editor::dbg-testno longer needs the cursor inside the test. Three new forms::dbg-test listopens a picker of every@(test)proc in the current buffer as you type (one row per test as<pkg>.<test>with<file>:<line>beside it, text afterlistfuzzy-filters, Enter builds and debugs the highlighted one);:dbg-test list alllists every test under the project root instead, using the same root and file cache:filesuses, with the current buffer's tests sorted first and a file name in the filter narrowing by file; and:dbg-test <pkg>.<test> [path]debugs a named test explicitly,pathbeing the.odinfile that holds it (spaces allowed), the current buffer when omitted. Accepting a picker row runs the explicit form, so it lands in the:history.:dbg-test lastreruns the last test any form asked for, rebuilding it first, from anywhere — and thelistpicker preselects that test, so:dbg-test list+ Enter is a rerun too. The buffer may be unsaved while listing; the run still needs it saved and unmodified.list,list allandlasttab-complete. The test enumeration is the samecore:odin/tokenizerlexer the cursor resolver uses (_odin_tests_in_src), with its own tests indbg_test_list_test.odin.
Fixed
editor: no completion inside an Odinimport "…"path, and a spurious full-list popup after its closing quote. The comment/string gate that keeps the LSP from being spammed inside docstrings also silenced the one string that is a completion context: ols completes collections afterimport "and packages aftercore:/math/._in_comment_or_stringis now_lex_ctx_at, which reports which context (code / comment / string / char literal / after-slash), and the completion gate lets a string through when the line starts with theimportkeyword in an Odin buffer (imports := "…"andforeign importare deliberately not matched — the latter's strings are library paths ols has nothing for). The second half: ols advertises"as a trigger character, so typing the closing quote of the import path popped the whole unfiltered list. A quote atcursor-1while the cursor is in plain code can only have closed a literal (an opening one would have left us inside it), so it never counts as a trigger now. SignatureHelp keeps the plain gate with no exception. The gate finally has a test (completion_gate_test.odin, the openREVIEW.mditem).editor/linux/macos/windows: the autocomplete documentation panel could not be scrolled, and clipped long docs silently. The panel now grows to fit its text up to 24 rows (float.DOC_MAX_ROWS, shared so the three renderers cannot drift), placed away from the cursor line; when the text is still longer it scrolls with a thumb on the right edge.PageDown/PageUpmove a page,Ctrl+D/Ctrl+Uhalf a page — all four are unbound in Insert mode, so consuming them costs nothing, and they are consumed unconditionally so the same key cannot dismiss the popup on one item and scroll on the next — and the mouse wheel scrolls it with the pointer over the panel (over the list it still steps the selection). Clicking inside the panel no longer dismisses the popup. Wrapping is per-frontend, so the scroll lives in text rows incore/floatand each renderer reports the limit and page size back once per frame (set_doc_metrics); the offset belongs to one item and resets on every way the selection can move (keys, wheel, click, filter rebuild). On macOS the Metal text extractor used to cap a framed text at a fixed line count, which is exactly the lines a scrolled panel needs; it now walks the frame in windows and emits quads only for the band under the scissor, so a long doc costs its visible rows rather than its whole text.panetree: floating panes could sit on top of the bottom status / command strip.compute_layouthanded floats the full content rect, so a float dragged or resized to the window's bottom edge covered the strip where:commands are typed. Tiles still use the whole rect; floats are now laid out and clamped against the rect minusstatus_h, which is also what the between-paint geometry commands (move / resize / drag) see. A float may still cover the status bar of a pane stacked above another — move it, or hide it withCtrl+W u.destroyalso cancels an in-flight float drag before freeing the float it references.editor::dbg-testcould debug the wrong test. The resolver searched upward first and took the nearest proc without checking the cursor was inside it, so the cursor on a later test's@(test)line, or in the blank/comment lines above it, built the previous test; breakpoints in the intended test never fired. It also returned everything afterpackage, sopackage foo // commentproduced a selector (foo // comment.second) that matched no test. Both resolvers now lex the buffer with the stdlibcore:odin/tokenizer(core/editor/dbg_test_resolve.odin), so braces in strings, runes, comments and inline signature types (-> struct {x: int} {) are not mistaken for a body, and nested procs stay inside their test. A test owns its attributes through its closing brace plus the blank/comment lines directly above; a cursor in a non-test proc is now an error instead of silently selecting the next test. Verified live on macOS with lldb-dap on a two-test fixture under a path with a space: from the second test's attribute and from its body, onlysecondran, its breakpoint verified and hit with correct locals, and step-over stayed in the test.macos/windows: two capability defects that silently degraded every later frame instead of latching the GPU path off. Both were the same shape: the renderer declines correctly per frame, but nothing ever concludes that it will keep declining, so the cost is paid forever. Nothing in the tree writesgpu_renderer = falseon a runtime failure — the only writers are the= truedefault,:set gpu/nogpu, the snapshot parser and the benchmark.macos: the eligibility gate never asked whether the glyph pipeline compiled. Windows computesd3d_ready() && d3d_text_init(...); the Metal path only checkedgpu_rendererand "am I being called frommetal_draw_frame". So a permanently failingmetal_text_initletgpu_frame_buildclaim the frame, skipped the Core Graphics replay, failed at encode, and leftdrawRectto record and replay the entire frame a second time into the view — every frame, forever, with theCAMetalLayerflip-flopping hidden/shown. Demonstrated by corrupting the MSL source: before the fix the--render-gpu-captureharness never terminates; after it, the pass simply never engages and reportsused=0 fell_back=0. Chosen over latching on encode failure becausemetal_text_initalready is the latch and the gate was not consulting it — and because the encode path also fails on texture creation and buffer allocation, which can be transient, where one strike would kill the renderer for the session.windows: a font change permanently pinned the GPU path off.draw_refresh_fontreleased the text format but never reset the 16-entry font intern table, whose key is(IDWriteFontFace, emSize)withemSizeDPI-scaled. Cycling:fontsize, or dragging between monitors of different DPI, filled it — and a full table declines every GPU frame from then on, logged once and thereafter silent. It now resets the intern table and the atlas together (the atlasGlyph_Keyholds those ids), at the one point that is safe: a frame boundary before any quad has been emitted.- Both frontends'
gpu_usedcounter counted frames the builder accepted, not frames the pass put on screen — a failed encode fell through to the 2D renderer without adjusting it, so a Direct2D/Core Graphics frame was reported as GPU-drawn. That counter is whattests/render/gpu.shandgpu-win.shassert on. - Also removed:
g_d3d.disabled, written twice and read nowhere (the session pin works viaattempted && !ready), and a dead local in the D3D encoder. Corrected a stale comment claiming strokes, ellipses and wrapped text still fall back — all four have been handled since the Windows renderer landed; onlyText_Lineis unsupported, and nothing records it.
Changed
core/macos/windows: the two GPU renderers' shared half moved intocore/render/, which existed already but held only the two pieces the Windows port happened to need first. Every platform name survives as a one-line alias, so no call site changed and the macOS render-check stayed byte-identical at every step — 0 of 4,860,800 pixels across all three cases, withinstances partial=289 full=755unchanged.instance.odin— the 64-byte GPU instance and theGPU_KIND_*constants, which were already field-for-field identical (the Windows copy says so in its own comment), plus thescissor_intersectthat existed in three copies. It gainsoffset_ofasserts on all four fields: the WindowsINPUT_ELEMENT_DESCand the MSL struct both mirror that layout by hand, nothing else checks them, and macOS had no assert at all.atlas.odin— shelf packer, subpixel phases, dirty-rect bookkeeping and the exhaustion/generation policy, verified identical down to the comments before the move. Each platform'sGlyph_Atlas_Statenow embedsAtlas_Commonwithusing, so^Glyph_Atlas_Statepasses straight to the shared procs. The dirty box adopts Windows' all-zero empty state (a zeroed atlas is then already valid, with no ordering dependency on init) and macOS's clampeddirty_rect(a strict superset — an upload wider than the texture shears it).EDITOR_GLYPH_ATLAS_DIMis now read one way and clamped toGLYPH_ATLAS_DIMon both; the Windows copy had accepted 8192, larger than the atlas it sizes.stage.odin— the staged fixture both harnesses compare against. It had already drifted: macOS said "framesetter" where Windows said "layout", in a string both platforms render, so the two were comparing against subtly different pictures. macOS's wording is the one kept, so Windows needs a one-timemake render-baseline-windows.run_key.odin—Glyph_Run_Key, one concept in two copies differing only in span field names.- Tests moved with the code:
core/rendernow runs the union of both platforms' packer/phase/dirty cases, each of which had coverage the other lacked (19 tests, up from 8). What stays platform-side is what needs a device. - Deliberately not shared, recorded in
CLAUDE.mdso it is not re-litigated:gpu_frame_buildand its leaf decomposers (the rect types differ in layout and semantics, and a neutral-rect converter would be as long as the ~10-line leaves it deduplicates); the keyed slot map and rasterisation; and the glyph-run cache — macOS caches finished instances against a rounded origin, which Windows cannot copy because it must round the baseline rather than the layout origin. Windows wants a shaping cache instead, keyed with no positional component; itsGlyph_Run_Keyandpaint_text_utf8_keyedare recorded today with no consumer.
Fixed
macos: live window resize redrew slowly and the content trailed the window edge. Three causes in the Metal presentation path, all per resize step. (1) The IOSurface ring was keyed on the exact backing size, so every drag step created three new full-window surfaces (allocate, lock, zero-fill, Core Graphics context, Metal texture) and released the old three — measured with the newresizebenchmark workload as a rebuild on 120 of 120 frames; the timing started after that call, so no timer had ever seen it. The ring is now allocated with slack (metal_surface_plan: dims round up to 256 px, geometric headroom while dragging, shrink only outside a drag once the ring holds twice a fresh allocation's area) and kept while the frame fits; the frame occupies the surface's top-left, which the Core Graphics CTM, the GPU pass's viewport uniform and the blit'ssurface_extentuv scale keep in step. After the change the same workload rebuilds 0 times and stays byte-identical undermake render-check/make render-gpu. (2) TheCAMetalLayeris a hand-added sublayer with no delegate, so eachsetFrame:started CoreAnimation's implicit 0.25 s bounds/position animation (verified:animationKeysreportedposition,boundson every resize frame) andsetHidden:cross-faded; anactionsdictionary ofNSNullremoves both. (3) Presentation was never synchronised with the resize transaction: whileinLiveResizethe layer now usespresentsWithTransactionwith Apple's commit /waitUntilScheduled/presentsequence (about +0.5 ms per frame, only while dragging), andwindowDidEndLiveResize:kicks one redraw so an over-grown ring settles.- Instrumentation:
resize_ms,resize_rebuildsandring_surface=WxHin the benchmark line and the passivemac/renderdebug line;--render-benchmark-workload=resizechanges the window size every frame;--render-benchmark-live-resize=true(RENDER_BENCHMARK_LIVE) forces the live presentation path headlessly.draw_ms/max_msnow include the ring (re)allocation.
- Instrumentation:
0.0.33
Changed
macos/editor: the GPU renderer is now the default. Frames are built as one ordered instance stream — glyph quads out of a texture atlas, rectangles, strokes and signed-distance shapes alongside them — and rendered into the retained surface ring, instead of being replayed through Core Graphics into an offscreen bitmap. Measured on a 1644-line Odin buffer at 46 visible rows: typing 2.7-3.0 → 1.6-1.8 ms (5% damage, 3 rows repainted), full repaint 4.0-4.2 → 2.7 ms.:set nogpuopts out,:set nogpu!persists it, andset nogpuin~/.editorworks the same way; other frontends ignore the setting.- One setting had to be split in two first.
shader_enabledselected the Metal presentation path and gated a post-processing effect whose default is.Color_Gradeat 0.25 intensity — so flipping it would have quietly graded every buffer. It now means the effect only, and keeps its default (off); the newgpu_renderermeans frame construction and implies Metal presentation on its own. The effect is passed as.Noneunlessshader_enabled, which is what keeps the default look identical to Core Graphics. Verified in both directions rather than assumed: against a Core Graphics reference the default configuration differs on 95,361 pixels (glyph antialiasing), while addingset shadermakes all 4,860,800 differ. The render captures were also changed to stop forcingshader_enabled = trueandshader_effect = .None, which they did back when the flag was what selected Metal — every capture had been exercising a configuration no real session has. - Split panes were checked before the flip, because nested clips are the one structural difference that could produce wrong pixels rather than a clean fallback: a pane clip becomes an integer scissor rect through
gpu_frame_rect_to_device(floor on the origin, +0.5 round on the far edge) where Core Graphics clips with an exact float rect and antialiases the edge. It is clean — the separator matches exactly, and the whole split frame differs visibly on 0.209% of pixels, all glyph edges with no concentrated block. Getting there took two false alarms worth recording: the GPU capture callback applied--render-snapshot-stagebut not the new--render-snapshot-split, so a split frame was being compared against an unsplit one and the separator read as a seam; and splitting to the same file put two editors on one path, where the second found the first's swap file and raised a "backup found" notification at a moment that depended on the debounced swap flush. - New
--render-diff=<a>:<b>:<delta>:<max>compares two captures headless under a tolerance and exits — the check a GPU-vs-Core-Graphics comparison needs, sincecmpcannot express it. It replaces the throwaway scripts these comparisons had been living in. Alpha is excluded from the "visible" count on purpose: the captures composite opaque, so an alpha-only difference cannot be seen, and counting it inflated the answer 3.7x.make render-gpugained the split comparison andmake render-checkasplitcase;--render-no-gpu-frameis the explicit Core Graphics arm now that "no flag" means GPU. - What this costs, stated plainly. Metal presentation allocates the IOSurface ring — 3 slots at window resolution, about 60 MB at a 1400x900@2x window — where the default path allocated none, plus the 4 MB glyph atlas. Dropping the ring to two slots would save roughly a third and is a separate measured change. Glyph antialiasing differs from Core Graphics on ~0.3% of a frame's pixels, and the diagnostic squiggle renders visibly lighter. And the honest limit of the testing: hover floats, palettes, notifications, results, debug and chat panes, inline diff, wrapped text and IME preedit go through the new path with no fixture covering them. Anything the pass cannot draw hands the whole frame back to Core Graphics, so the bounded failure there is speed rather than correctness — but the mid-frame atlas reset fixed in this same release is proof that wrong-pixel bugs in this path are possible, not hypothetical.
- One setting had to be split in two first.
Fixed
macos: running out of glyph atlas corrupted the frame instead of degrading it.glyph_atlas_slotreset the atlas inline when the shelf packer could not place a glyph, then carried on — but a reset zeroes the whole texture and re-packs from empty, while every quad the frame has already emitted still carries UVs into the old layout. Those quads then sample cleared or re-packed texels, so the frame comes back shredded: most glyphs blank, the rest showing other glyphs' pixels, words rendering as different words. Reproduced by shrinking the atlas to 256px — a staged frame went from 0.31% of pixels visibly different against Core Graphics to 1.93%, with legible but wrong text. At the real 2048px size a Latin frame uses roughly 200 slots of about 5,000, so this needs a large glyph set to reach; but the atlas accumulates across frames and only resets when full, so a dense CJK buffer, or a long scroll through one, gets there — and the symptom is an occasional flash of garbage that never appears in Latin-only testing. Now the packer failing sets anexhaustedflag and nothing else:gpu_frame_builddeclines the frame so Core Graphics draws it correctly, and the reset happens in the newglyph_atlas_begin_frameat the start of the next frame, which is the one point where no emitted quad can still be referring to the old layout. Recovery is by construction — the next frame starts from an empty atlas and re-fills with the glyphs actually on screen — and the degenerate case where one frame needs more glyphs than the atlas holds settles into "every frame falls back", which is slow and correct rather than fast and wrong. A healthy frame is byte-identical across the change, and Core Graphics output is unchanged.- The check is exact, which is the nice part. A declined frame blits the Core Graphics surface untouched, so
make render-gpucan require the exhausted capture to equal--render-snapshotbyte for byte rather than compare against a tolerance. NewEDITOR_GLYPH_ATLAS_DIMmakes exhaustion reachable on an ordinary fixture; without it the path needs thousands of distinct glyphs and would have gone on being untested. 3 new tests cover the frame-boundary policy directly (a healthy atlas is left completely alone — a stray reset would throw away every rasterised glyph; an exhausted one resets, clears the flag and bumps the generation so cached runs holding old UVs are dropped; and the packer reports failure rather than placing a glyph over a live slot, which is the signal the whole fallback depends on).
- The check is exact, which is the nice part. A declined frame blits the Core Graphics surface untouched, so
macos: the GPU frame pass draws wrapped and truncated text, so an open autocomplete popup no longer turns it off. One command kind the pass cannot draw fails the whole frame, andText_In_Rectwas unsupported — while every row of the completion float, the hover label and the LSP documentation panel is drawn through-[NSAttributedString drawInRect:]. So with a completion list open, which is to say while typing code with a language server attached, the pass handed every frame back to Core Graphics. Measured on the staged fixture: 1 of 10 frames GPU-drawn before, 10 of 10 after. Thetypingbenchmark never opens a float, which is exactly why it reported 100% GPU use and this went unnoticed — the same shape as the caretStroke_Paththat silently disabled every Insert-mode frame, and a reminder that a census over two synthetic workloads is not a statement about real sessions. Newglyph_extract_wrappedpicks its layout from the paragraph style, the way AppKit itself does: a truncating mode becomes oneCTLinecut to the width with an ellipsis token built from the string's own attributes, anything else goes throughCTFramesetter. The framesetter rather than aCTTypesetterloop because the doc panel's text is multi-paragraph andCTTypesetterSuggestLineBreakdoes not stop at a hard newline — a typesetter loop runs the paragraphs together. The existing single-line path is refactored onto the shared run walk and its GPU output is byte-identical across the change.- Two defects the first working version had, both found by looking at the pixels rather than the numbers. The overall frame difference against Core Graphics barely moved (4.64% → 4.87%), and 79% of that difference is a ±1 rounding delta on the translucent selection fill — so the aggregate says nothing. Cropping the float and comparing the two images side by side showed them immediately. First, the last line of the doc panel was missing:
CTFramesetteronly emits lines that fit its path entirely, wheredrawInRect:draws a straddling line and lets the clip cut it, so a panel sized to its own text lost the paragraph after the hard newline. Fixed by laying out against the rect plus one line of slack and giving the command its own scissor batch — the same clip mechanismPush_Clipalready uses — so the overflow is cut exactly where Core Graphics cuts it. Second, strikethrough was gone from deprecated completion rows: it is a decoration AppKit draws from the attribute, not a glyph CoreText shapes, so walking runs drops it silently. Now emitted as a solid quad at half the x-height above the baseline with the font's own underline thickness, and checked once per command rather than per line so the hot buffer-row path pays nothing for an attribute onlydraw_truncatingever sets. - Verification. The comparison pipeline is validated by a control that must be exact: with the GPU path declining, the capture is byte-identical to the Core Graphics snapshot (0 of 4,860,800 pixels). Against that reference the GPU frame differs on 4.8% of pixels, but 95% of those differ by ≤32/255 and only 0.31% differ visibly, all on glyph edges with no concentrated block anywhere. That the float's glyphs are correct rather than merely present is shown by a negative control that claims the frame but drops the wrapped text: doing so makes the frame worse against Core Graphics (19,290 visibly different pixels against 15,276), so the glyphs are moving it toward the reference, not away. The staged fixture's documentation string is now long enough to wrap and contains a hard newline, because a one-line panel exercises neither line ordering nor the frame's y-flip.
make render-gpugained a float case asserting the pass claims those frames (fell_back=0); reintroducing the gap behindEDITOR_NO_WRAP_TEXTmakes it fail, which is the check the original defect needed and did not have. Core Graphics output is unchanged — verified against the pre-existing baselines before the fixture was extended. - Still on Core Graphics:
Text_Line, which no call site emits today. It stays in the fallback branch so that adding one cannot silently paint the wrong thing.
- Two defects the first working version had, both found by looking at the pixels rather than the numbers. The overall frame difference against Core Graphics barely moved (4.64% → 4.87%), and 79% of that difference is a ±1 rounding delta on the translucent selection fill — so the aggregate says nothing. Cropping the float and comparing the two images side by side showed them immediately. First, the last line of the doc panel was missing:
macos: the GPU frame pass renders into the retained surface ring, so a keystroke repaints three rows instead of forty-six. The pass drew straight intonextDrawable; a drawable is cleared every frame and rotates through the swap chain, so it had no previous content to build on and every frame had to be whole. That made the GPU path slower than Core Graphics on typing — the one workload where latency is felt — and it was the item gating whether the path was worth shipping at all. It now runs as two render passes in one command buffer: pass 1 targets the selected ring slot's texture withMTLLoadActionLoad, scissored to that slot's owed damage, and pass 2 is the existing fullscreen blit (so a GPU frame now also picks up the shader effect, which it previously bypassed). The ring already solved the hard half —metal_surface_accumulate_damagerecords every frame's damage against every slot that did not paint it, so when a slot is next selected it owes exactly what it missed — and the in-flightcommand_buffercheck inmetal_lock_next_surfacebecomes load-bearing rather than vestigial: it is what stops the GPU rendering into a slot a previous frame's blit is still sampling. Measured on a 1644-line Odin buffer, 46 visible rows, 300 frames: typing 2.72-2.96 ms (Core Graphics) → 1.57-1.78 ms (GPU), at 5% damage and 3 rows repainted where the GPU path was previously pinned at 100% and 46; full repaint 4.0-4.2 → 2.7 ms.GPU_FRAME used_pctstays 100% on both.- The blocker was
kIOSurfaceLockAvoidSync, and it fails silently. Once Metal has used an IOSurface as a render target the CPU cannot map it without a layout transition, which is precisely what that flag exists to refuse — so after the first GPU frame,IOSurfaceLockfailed on every slot, forever.metal_lock_next_surfacethen reported "no slot available", every subsequent frame declined the shader path and drew straight into the view, and nothing was logged because a declined frame is a normal transient state. It presented as a hang in the capture harness, not as a rendering fault. The fix is to retry without the flag, which is safe rather than a workaround: the command-buffer check above has already established that no frame is still reading the slot, so there is no GPU work left to wait on — measured at ~5 us against a frame budget in milliseconds.EDITOR_NO_PASS1is kept as the negative control that identified it (with the pass off the lock never failed; with it on every slot failed permanently). - Damage is normalised to pairwise-disjoint rects before recording, and the same set is then used by the record walk, the Core Graphics clip and the GPU scissors. The GPU pass draws its instance stream once per damage rect, so an overlap would composite the renderer's translucent fills (
cursor_line, selection, the block cursor) twice and come out the wrong colour — andrender_damage_set_addmerges only into the first rect it intersects and never re-runs, so a set is not disjoint just because it was built through it. A bounding box will not do here: a caret move underset rnudamages a full-height gutter strip alongside the row rects, so the bbox of a typing damage set is close to the whole pane and would expand the three-row repaint straight back to a full one. Splitting can produce more rects than it consumed; overflowing the set falls back to one covering rect, which over-draws but stays correct precisely because both consumers use that same result. Worth recording honestly: instrumented against real workloads with both absolute and relative line numbers, it never fired — the existing damage producers already emit disjoint rects (key_damage_add_screen_rowinsets row rects past the gutter strip for exactly this reason). It is a guard against a hazard the GPU path made consequential, not a fix for an observed bug, and the 4 unit tests are what hold it. - New
make render-gpucaptures the same editor state twice through the GPU pass — once as a frame a targeted damage set produced, once repainted whole — and requires them byte-identical. Stale or blank regions outside the damage show up immediately; this is the check the previous change lacked, and three-rows-and-black-elsewhere would have failed it. It nearly passed for the wrong reason:--render-snapshot-stageleaves the editor in VisualChar with extra cursors, both of which makekey_targeted_damagebail out to a full repaint, so the "partial" frame was not partial at all. Staging is dropped and the harness now asserts the partial frame's instance stream is materially smaller than the full one (303 vs 769), so that cannot come back silently. New--render-gpu-moves=Ndrives real cursor keystrokes so the captured frame is one targeted damage produced, and--render-gpu-fullrenders the same state whole as the reference. Orientation was checked on the first capture as planned — a Metal render pass and the Core Graphics bitmap both put frame-top at texture row 0, confirmed by comparing the GPU frame against a Core Graphics render of the same state (1.1% of sampled pixels differ, all glyph antialiasing) and against its own vertical flip (7.1%). - Two measurement traps worth remembering, both of which produced confident wrong numbers before being caught: the
typingworkload leaves a swap file, so every run after the first opens a recovery prompt instead of the file — which disables targeted damage entirely and reports 100% damage on paths that are actually 5%; and the fixturemain.cis 17 lines, so it fills fewer rows than the window and cannot show partial repaint at all. Both are now handled in the harness scripts.
- The blocker was
macos: the GPU frame pass could paint nothing at all, and could paint a stale palette — two defects in the same mechanism, both from the whole-frame pass landing without a per-frame handshake.g_gpu_frameis a process-global instance stream andokwas the only thing gating whether it got encoded, so (a) any early return fromdraw_frame_into_contextleft the previous frame's instances marked good, and because colours are resolved at record time, encoding a stale stream paints a stale palette — this is why a mid-session:themeappeared to do nothing in a capture; and (b)draw_frame_into_contextdecided to skip the Core Graphics replay from that flag alone, with no idea which of its three destinations it was painting into. Two of them — the view's own backing store ondrawRect's fallback path, and the snapshot harness's bitmap — have no GPU pass behind them, so they recorded a frame, built a stream nobody consumed, and painted nothing. Every one ofmetal_draw_frame's thirteen early returns (ring exhaustion, no drawable while occluded, allocation failure) was a blank frame. Reproduced first as a blank capture, then fixed:okis cleared before any early return, an empty command list no longer claims the frame,draw_frame_into_contexttakes an explicitgpu_eligibleso each call site states whether the GPU will consume the frame, and an encode failure afterokdeclines the frame rather than blitting a surface Core Graphics deliberately never painted. Also stops the surface ring assertingcontent_validfor a slot the GPU path left unwritten.- That last one exposed a third thing: as written, the GPU pass had to render every frame in full. It drew into a drawable that is cleared each frame and rotates through the swap chain, so it had no previous content to add to — partial damage would have left everything outside the damaged rows black. With
content_validtelling the truth the pass correctly got full damage, and the earlier "GPU typing is 40% faster" number turns out to have been measuring a broken frame: damage stayed targeted, three rows were drawn, and the other forty-three were the clear colour. The benchmark does not check pixels, so it read as a win. That forced-full-frame constraint is lifted by the next entry, which moves the pass onto a target that survives between frames.
- That last one exposed a third thing: as written, the GPU pass had to render every frame in full. It drew into a drawable that is cleared each frame and rotates through the swap chain, so it had no previous content to add to — partial damage would have left everything outside the damaged rows black. With
macos: the shader pipeline's dominant per-frame cost is CPU rectangle fills into the offscreen bitmap, not text — and that invalidates the conclusion the GPU glyph path was measured against. Timing the Painter replay per command kind, in the same frame, with the same command list, only the destination differing:Fill_Rectcosts 0.035 ms into the window's context and 1.628 ms into the IOSurface-backedCGBitmapContext— 46x. Clips, strokes and text cost the same in both (text is 1.13 ms either way). It is a handful of fills per frame, so these are the large ones: the whole-window background and the pane background, two full-surface opaque fills, roughly 38 MB written per frame — memory bandwidth, and one of the two entirely overdrawn by the other. Skipping the window fill saves 0.36 ms and leaves both render fixtures byte-identical, which says it is pure overdraw there; not landed, because two fixtures with one full-coverage pane each cannot show what a split with an odd pixel remainder would leave behind. The IOSurface is now created with an explicitkIOSurfaceCacheModeof write-back (a surface meant for GPU access otherwise comes back write-combined, where Core Graphics' read-modify-write blending pays a full memory round trip per read); that was the first hypothesis and it is worth having, but it accounts for only 0.13 ms of the gap.- Why this matters more than the number: the GPU glyph path was measured inside a pipeline carrying ~1.6 ms of fill cost it does nothing about, so "no win" was the wrong conclusion drawn from a real measurement. The earlier claim that moving rectangles to the GPU is pointless came from the direct pipeline, where fills really are 0.11 ms — generalising it to the shader pipeline was the mistake. Text and rectangles are not separable here: leaving the fills on the CPU keeps the offscreen bitmap, and keeping the bitmap is what costs 1.6 ms. The architecture that pays is the whole frame on the GPU — no
CGBitmapContext, no full-surface fills, no blit — with the Painter's rect commands becoming instanced quads alongside the glyph quads it already feeds.
- Why this matters more than the number: the GPU glyph path was measured inside a pipeline carrying ~1.6 ms of fill cost it does nothing about, so "no win" was the wrong conclusion drawn from a real measurement. The earlier claim that moving rectangles to the GPU is pointless came from the direct pipeline, where fills really are 0.11 ms — generalising it to the shader pipeline was the mistake. Text and rectangles are not separable here: leaving the fills on the CPU keeps the offscreen bitmap, and keeping the bitmap is what costs 1.6 ms. The architecture that pays is the whole frame on the GPU — no
debug/linux/macos: every repaint calledrealpath()on each pane's filename — twice — to look up breakpoints that in almost every session do not exist. The canonical path is needed only to key the debug gutter (breakpoint dots, the stopped-line chevron), but it was resolved unconditionally indraw_paneand again in the breakpoint-column width helper, once per pane per frame on both POSIX frontends.realpath()is a filesystem walk — a lookup per path component — so this is a small CPU cost on a local SSD and a much worse one on a network mount or a deep tree, which is the kind of regression that never shows up on the machine it was written on. Newdebug.breakpoint_file_count()(the breakpoint registry is a package-global map, so this is alen) lets both frontends settle the question with two pointer-cheap checks first: no breakpoints anywhere and no live session means no canonicalisation, no allocation for the path, and no breakpoint maps. Behaviour is unchanged by construction — in that case the maps were empty and the stopped line was -1 either way. macOSpane_setup0.31 → 0.26 ms per frame; the syscalls go from two per pane per frame to none. Same fix at both Linux sites (pane_load_dbg_state,_bp_col_w). Also fixes a leak found in the same block:draw_paneread the stopped file's path withdbg_stopped_file_c— which hands back an owned copy — and never freed it, leaking one path per pane per frame for as long as a debug session was attached; its sibling inpane_bp_col_walready got this right. macOS render output byte-identical (both snapshot fixtures, 0 of 4,860,800 pixels);linuxandwindowstype-check clean.buffer/editor/macos/windows: the matching-bracket highlight cost 3.3 ms of a 4.9 ms frame once the cursor was deep in a file — every frame, on every frontend. Having found the byte offset of the matching bracket,editor_matching_bracket_rcconverted it to a row by walkingrope_offset_for_linefrom line 0 until it passed the target: a tree query, each with its own leaf newline-scan, per line. With the cursor at line 3000 of a 3338-line file that is 3000 tree walks per frame — and it ran even when the answer was one line away, because the walk always starts at zero.macos/renderer_core.odinandwindows/draw_core.odineach carried their own copy of the same loop, so the cost existed in three places. Newbuffer.rope_line_of_offset(n, pos)does it in O(log n) by descending on the per-node newline counts the rope already maintains (the_newlines_beforewalk, now public), core uses it, and both shims were rewritten to delegate toeditor_matching_bracket_rcinstead of duplicating the conversion — the duplication is the reason one fix had to be found three times. Measured on a 3338-line Odin buffer with the cursor at line 3000: a keystroke frame 2.20 → 0.41 ms (-81%), a full repaint 4.93 → 3.51 ms (-29%), and the frame cost stops depending on where in the file you are working at all (full repaint at line 1 vs line 3000: 3.39 vs 3.51 ms, against 3.31 vs 4.93 before). Cursor-at-line-1 frames are unchanged, which is why this went unnoticed — every benchmark and every casual look at a small file starts at the top. The remaining bracket cost isfind_matching_bracket_at's own scan (0.02–0.06 ms), which is not worth touching. New--render-benchmark-line=Nparks the cursor and viewport before a run, since a workload that can only type at the top of a file cannot see any of this. 3 new tests (core/buffer/rope_test.odin:rope_line_of_offsetagainst a hand-checked layout incl. an empty line, negative/nil/past-the-end clamping, and agreement withrope_line_spanfor every offset of a 400-line buffer;core/editor/fold_test.odin:editor_matching_bracket_rcrow/col pinned in both directions across an 800-line brace pair).- Worth recording as a negative result: the suspected cause was the cross-line syntax state cache, which
editor_note_mutationinvalidates wholesale on every edit, leaving_line_state_atto re-extend from line 0. Instrumented, it does not scale with cursor depth (syntax_ms0.048 at line 1 vs 0.016 at line 3000) and is not worth changing.
- Worth recording as a negative result: the suspected cause was the cross-line syntax state cache, which
buffer/editor/linux/macos/windows: drawing the fold column cost more than painting all the text — a fifth of every frame.editor_fold_gutter_markerruns for every visible row of every frame on all three frontends, and its comment claimed "one capped in-line byte scan plus the lazily-cached block-comment state". Both halves of that were wrong about what they cost. The scan read the line throughbuffer.rope_byte_at, which is one tree descent per byte, turning an O(len) scan into O(len · log n); and the "cached" block-comment lookup re-ransyntax.detect_lang— a scan over theEXTENSIONStable — on every call, twice per row, before it could reach the cache. Measured on a 46-row full repaint of a 3338-line Odin file, the marker alone was 0.76 ms of a 3.73 ms frame, against 1.21 ms for painting every glyph in the window. Three fixes, none of them changing behaviour: newbuffer.rope_read_into(n, start, buf)copies a run into caller-owned storage in one traversal (no allocation) and the fold scan now reads the line into a stack buffer and scans that; newbuffer.rope_line_span(n, row)returns start and end together, because askingrope_offset_for_lineandrope_line_lenseparately costs three_line_startwalks — each a descent plus a leaf newline-scan — where two will do; and_line_state_atgained a fast path that answers a cache hit without deriving the language, keyed on an FNV hash of the filename alongside the rope version. Keying the cache on the name rather than on the detected language is what makes skipping the derivation sound, and it is deliberately the shape that cannot rot: a rename that changes the language changes the hash and the memo simply misses, so no present or future filename writer has to remember to invalidate anything. Net on the same measurement: the gutter phase 0.894 → 0.475 ms (-47%), the whole editor frame 3.73 → 3.46 ms (-7%). What remains of the probe (~0.34 ms) is the unavoidable per-row rope read — the renderer already fetches those same bytes one step later, so handing them to the marker would remove it, but that changes a core signature all three frontends call and is left as a separate change. 5 new tests (core/buffer/rope_test.odin: bulk read across leaf boundaries, agreement withrope_byte_atat an interior offset, short reads at end-of-rope, nil/empty/negative guards, andrope_line_spanagreeing with the two accessors it replaces on every row of a buffer whose last line has no newline;core/editor/fold_test.odin: the bracket scan's edge cases pinned after it moved off per-byte reads —} else {is still foldable, braces inside string and char literals still do not count, a balanced line is not foldable — plus a rename across languages proving the line-state memo re-arms instead of latching). Also adds row-level phase timers (fetch/gutter/overlay/list/annot) to the macOS benchmark and passive-timing lines, which is how the cost was found;row_othernow subtracts every named part through a sharedrender_row_other_secso the two emitters cannot drift about what "other" means. macOS render output is byte-identical across the change (both snapshot fixtures, 0 of 4,860,800 pixels);windowstype-checks clean,linuxis unverified as usual.editor/linux/macos/windows::treecould take the whole editor down with it — and a freeze used to leave no trace at all, so there is now a UI-thread stall watchdog that records where the wedge is.core/filetree's package-global_nodes: [dynamic]Nodenamed no allocator, so it bound tocontext.allocatorat its first growth and kept it forever — and one path in (a:treeaccepted from the cmdline picker) arrives with a per-editor rope pool installed. The node array then lived in that editor's arena, and the next:einto that pane — including opening a file from the tree itself — reset the pool underneath it (_perm_reset→rope_pool_free_all). TheNodestructs read back as recycled rope nodes,depthcame out in the billions, andrender's indent loop appended gigabytes of spaces until the machine swapped itself to death. Fixed on both sides of the failure and in the dispatch that set it up:_ensure_nodespins the array to the heap before it can grow (every other allocation in that package already named_heap()explicitly, so this only makes the array say the same thing);MAX_INDENT_DEPTH :: 32clamps the indent loop, because a wrong indent is a glitch while an unbounded append is unrecoverable; and Linux's cmdline-picker accept now dispatcheshandle_actionoutside the rope-pool/scratch scope — actions mutate process-global state (pane tree, file tree, results panes), and the 512 KB scratch arena is just as wrong for them, since a large directory listing exhausts it and comes back empty.core/plugin's text-listener list got the same explicit heap pin, and CLAUDE.md gained the converse of the per-editor-allocator rule (process-global state must never be allocated under a per-editor allocator) with both shapes that have now bitten spelled out. The rest of the commit is the diagnostic gap the hang exposed: a freeze leaves no artifact of its own — the process keeps running, writes nothing, and whatever ends it (a force-quit, a terminal HUP, End Task) is invisible afterwards. Newwatchdog.odinon all three frontends: the UI thread publishes a phase-tagged heartbeat (ui_beat(.Draw/.Key/.Mouse/.Events/…), with.Idlewhile parked inpoll()/GetMessageW, so an idle session however long is never a stall), and a monitor thread polls every 250 ms, reports at 5 s, and re-reports every 10 s — each report re-dumps the stack, so a slow-motion hang shows where it is spinning rather than only where it started. The POSIX frontends get a real backtrace (SIGPROF to the UI thread; the handler incrash.odinwalks that thread's stack into~/.editor.log); Windows has no signals, so the monitor suspends the thread and reportsrip/rsp/rbpout ofGetThreadContext— one frame, not a trace, with StackWalk64 noted as the upgrade path.elog.write_crashtook alevelparameter for it, since the watchdog writes from a signal handler and a frozen UI thread is not a fault. All three frontends also repoint stderr into~/.editor.logwhen it isn't a tty — a.appand a-subsystem:windowsbinary have none, so Odin panic text was simply discarded. Teardown hangs found while exercising the watchdog were fixed in the same pass: closing an fd does not release a thread blocked inread(), so:!shell readers and the git-diff reader are kicked with SIGUSR1 (noSA_RESTART⇒ EINTR ⇒ the loop breaks) before any join, and the fd is closed only after the reader has exited;writer_install_eintr_signalmoved to bootstrap, because SIGUSR1's default disposition is terminate the process, no core, so a kick that raced ahead of the first writer start would have killed the editor outright with nothing in the log; a reader still blocked despite the kick makes the UI thread abandon the session slot (leaking it, staying correct) instead of freeing buffers under a live reader; the shell reader publishesreader_donebefore its final post, so the drain it wakes finishes the session immediately instead of deferring the exit-code label to a 200 ms timer tick; and git-diff shutdown reaps with boundedWNOHANGpolling rather than an unboundedwaitpidon the UI thread. Newcore/filetreetest pins the ownership invariant directly — it resets a caller arena under the tree and asserts the nodes survive.editor/panetree:Ctrl+W qand:bdon the last pane terminated the whole session with no prompt, and:qonly ever checked the buffer it was typed in..WinClosereturned.CloseBufferto the frontend unguarded — help.md advertised it as "same as:bd", but the unsaved-changes check lived only on the:bdcmdline path — and on the last pane in the last tab the frontends quit, so a stray chord discarded every unsaved buffer silently.:q's guard was narrower still: it testede.dirtyon the focused editor, so quitting from a clean pane threw away unsaved work in every other pane and tab. All three paths now share one guard (_first_unsaved/_unsaved_statusincore/editor): the focused buffer is tested first so the message names the file the user is acting on, and the scope widens to every open buffer only when the close actually takes the process down — an ordinary pane close stays exactly as cheap as it was.core/editorcannot importcore/panetree(panetree imports editor), socore/hostwires two hooks:unsaved_hook→ newpanetree.find_editor, a predicate walk over every tab, pane and tab-group member that needs no caller buffer and therefore cannot truncate the wayall_editorscan; andwill_quit_hook→ newclose_focused_would_quit, which mirrorsclose_focused's early exits. Floats are deliberately excluded from the scan: a chat pane holding a typed-but-unsent prompt isdirtytoo, and since:wcannot save it, counting it would wedge:qon a buffer the user has no way to clean. Both hooks are nil in headless and test builds, where the guard keeps its old focused-buffer scope. The status line now names the offender ("E: unsaved changes in foo.odin — use :q! to force quit"), which is what makes a refusal actionable once the guard reaches beyond the focused pane. macOS gained the shutdown path it never had: Cmd+Q and the red close button reach AppKit directly and never touch command dispatch, soapplicationShouldTerminate:is bolted on withclass_addMethod(Odin'sApplicationDelegateTemplatehas no slot for it) and returnsNSTerminateCancelwith the same message. Same commit, same class of accident:Tabin the cmdline picker used to accept the selection on all three frontends, so typing:qand reaching for completion quit the editor —Tabnow only completes the name in place and leaves the cmdline open, andReturnis the only key that runs the selection. 8 new tests (core/editor/quit_guard_test.odin—Ctrl+W qblocked/allowed on the focused buffer,:qblocked by a dirty buffer in another pane,:q!ignoring it, a non-terminating:bdkeeping the narrow scope;core/panetree/find_editor_test.odin— would-quit true only on the last pane, dirty float ignored, dirty tiled pane found) plus corrected Panes /:q/:bd/ completion sections in help.md.elog/linux/macos/windows: every log record now carries the writing process id, and an ordinary kill is no longer filed asFATAL. Concurrent editor instances share one~/.editor.log, so records interleaved with nothing to pair them to a session — and the ambiguity bites exactly when it matters, since a vanished instance looks identical to a second one starting. The pid is rendered once atinitand reused verbatim by_format_record(… INFO [1234] subsystem: msg), pre-formatted rather than printed per record because that formatter also serves the contextless crash path, which must not allocate or call into libc; a record emitted beforeinitomits it entirely rather than printing[]. The macOSatexitMARK — the line that separates a clean exit from a process that vanished — assembles the same[pid]on the stack through newelog.pid_str, since atexit can fire after the Odin runtime is torn down. Levels: macOS traps SIGTERM/SIGINT/SIGHUP/SIGQUIT so an external kill leaves a trace, but logging those at FATAL made the label meaningless — most FATAL lines in a real log turned out to bemake mackilling a running binary or a Ctrl+C, burying the handful of genuine faults.write_crash_signalgained alevel(defaulting to.Fatal), the kill signals pass.Warn, and the hardcoded"fatal "prefix inside the message is gone because the level column already says it. Kills also skip the backtrace: through an external kill it just shows the idle run loop, and it was the bulk of the log's bytes. Finally, the three deliberate termination paths that used to leave nothing at all —:q,:wq, and a:bd/Ctrl+W qthat closed the last pane — now write an explicit "terminating" record on Linux and Windows, so a log that simply stops means the process did not exit on purpose.script: the~/.editor.luareentrancy guard was process-global, so one editor's in-progress config load suppressed an unrelated thread's. The recursion it exists to bound is a single call stack — config →editor.pane.split_h()→on_editor_init→InitEditor→ config — so the flag isthread_localnow. 46 tests reach_load_configthroughInitEditor, and whenever one landed inside another's window it silently skipped its own config, failingtest_config_load_is_not_reentrantabout one run in three. Production is unaffected: pane mutations are UI-thread only, so exactly one thread ever holds a copy.linux: a Wayland session could die with a protocol error on output hotplug, and twoui_postpayloads were being freed twice.wl_outputwas bound at version 2 unconditionally while teardown sentwl_output.release— a request that only exists since version 3, and sending it to an older object is a protocol error the compositor answers by dropping the connection, taking the editor with it. The bind now asks formin(advertised, 4)and disposal goes throughoutput_dispose, which reads the proxy's real version and falls back to a client-sidewl_output_destroybelow 3. The double-frees come from a contract that was only half-written down:ui_post's destroy hook runs after every drained callback, not only when a full queue drops the post. The chat hook request and the LSP dead-server notify each freed their payload inside the callback and handed the same pointer to the destroy — andhook_idle_handleclosed the client socket thathook_req_free_cwould close again, so an unrelated fd could be closed under whoever had since been handed that number. Both callbacks now free nothing; the one branch that must keep a resource (PENDING, which transfers the client socket tos.pending_hook_fd) marks the handoff withcfd = -1so the destroy skips it.EpDestroy's declaration inevent_post.odinand both destroy hooks now state the ownership rule, so the next payload type doesn't rediscover it.windows:~/.editor.logwas missing every lifecycle record frommain.odin, and logging real failures one level too low. The file-localEDITOR_LOG_*constants were copied from the long-deletedcore/api.hand their numbering had since diverged fromelog.Level:EDITOR_LOG_INFOwasc.int(1), which is.Debug— below the default.Infothreshold — sowrite_recorddiscarded "editor starting", "editor ready" and "clean shutdown complete" outright, andEDITOR_LOG_ERRORwasc.int(3)=.Warn, so "CoInitializeEx failed" and "GetMessageW failed — terminating" were filed as warnings. Windows crash diagnosis leaned on a log that never recorded whether the process finished starting or how it exited. Rather than renumber the constants, the untyped indirection is gone:editor_lognow takeselog_pkg.Leveland the call sites pass.Info/.Error, so the compiler checks the argument and the mismatch cannot silently recur. The crash-path helpers (editor_log_crash,editor_log_crash_signal) were never affected — they bypass the level filter by design.linux/main.odincarried the same untyped-c.intshim with its own copy of the constants; its numbering happened to still line up, so nothing was being dropped there, but it is converted to the same enum signature (and the never-referencedEDITOR_LOG_WARNdeleted) so the second copy cannot drift the way the first did. macOS needed no change — it already callswrite_record(.Info, …)with the enum directly. The one remaining int-typed level,core/plugin/vtable.odin's_log, is a genuine C ABI boundary and is correct:EDITOR_PLUGIN_LOG_*insdk/editor_plugin.hand its Odin mirror both matchelog.Levelexactly, and out-of-range values from a plugin are clamped to.Info.
Added
macos: the GPU frame pass now draws strokes and ellipses, so it stops falling back on the frames that matter. It previously handed the whole frame to Core Graphics if the command list held any kind it could not draw — and the insert caret is aStroke_Path, so every Insert-mode frame fell back, as did any frame with a diagnostic squiggle, a://caret, or a visible notification. The pass only ever ran on an idle Normal-mode frame, which is exactly why thefullbenchmark looked healthy: it never types.GPU_FRAME used/fell_backis now reported so that cannot hide again; it is 100% used on bothtypingandfull. Most of the coverage needed no shader at all — four of the five polylines are 2-point axis-aligned segments (the three carets and the float header rule) and all five stroked rects are axis-aligned hairline borders, so they become fill-rects, computed in the GPU builder rather than the recorder so Core Graphics output stays byte-identical. Only two shapes are genuinely new: the diagnostic squiggle (arbitrary-angle, round-joined) and the breakpoint dot, both signed-distance fields in the fragment shader. The instance grew aparamsfield carrying a kind, and itsuvslot is now a generalshape— atlas texels for a glyph, endpoints for a segment, centre and radii for an ellipse — which keeps one instance format, one draw call and one ordered stream for everything the renderer emits. Shapes land in the right places; the GPU squiggle is visibly lighter than Core Graphics' at the same width, an antialiasing-weight difference rather than a structural one, and a whole staged frame differs by 4.4% of pixels against 1% for text alone.macos/theme: the GPU frame path caches each row's extracted glyph run, so a scroll or a repaint stops re-deriving text that has not changed. Newmacos/glyph_run_cache.odinsits at theText_At→ instances boundary ingpu_frame_build, which previously rebuilt aCTLine, walked its runs, and did an atlas lookup plus an instance per glyph for every visible row of every frame. Measured on a 46-row full repaint:gpu_frame_build1.10 → 0.42 ms (-62%), whole editor frame 2.54 → 2.22 ms, at a 99.6% hit rate with 46 entries for 46 rows. Against the Core Graphics shader path (2.89 ms) the GPU frame is now ~23% cheaper.- Instances are stored relative to the run origin, which is what makes a scroll a hit rather than a miss: extraction runs against the origin's subpixel phase alone, and the whole-pixel part is added afterwards. That is exact rather than approximate —
floor(whole + frac + d)iswhole + floor(frac + d)for integerwhole, and likewise for the rounded baseline — so a cached run reproduces the positions extraction would have produced directly. - The key is a struct, not a content hash, and the reason is worth recording. Hashing the row's bytes is not sufficient:
apply_syntax_spansoverlays LSP semantic tokens, andeditor_apply_semantic_tokenssilently skips the overlay whensemantic_tokens_version != rope_version, so identical bytes render with different colours depending onrope_version— an edit on another line recolours this one. It is also not necessary: oncerope_versionis in the key,(editor, line, seg range)already determines the bytes. The key additionally carrieslang(derived from the filename, so a rename changes it) and the cross-line lexer state as the row was actually lexed, since the renderer reaches that two ways — carried from the previous painted row, or re-seeded from the line-state cache when damage skipped it. It is laid out to exactly 40 bytes with explicit padding so hashing its memory cannot pick up an alignment hole, hashed withcore:hash/xxhash, and compared field-wise on a hash hit so a collision is a miss rather than a wrong row. - Inputs that change every row at once clear the cache instead of entering the key:
font_version(family, size, ligatures — and with them the tab interval, which is derived from font size and moves every glyph after a tab), the atlas generation, the atlas scale, and a newtheme.version. That counter did not exist;apply_syntax_spansreads the palette live through the pointertheme.get()returns, so a:themeor:colorchanged colours with no signal at all. It is bumped inset_by_nameandset_color— the two procs that mutateg_theme, and the choke point for all seven call sites (:theme,:color, two plugin ABI entries, two Lua entries) — and only on success, so a rejected command does not invalidate for nothing. - Because
rope_versionis in the key, an edit strands every entry, so the cache is bounded by an entry cap and clears wholesale when full — the policy the glyph atlas already uses, and a refill costs one frame. - Removes the superseded text-only GPU pass (
--render-glyph-gpu,metal_text_encode,g_text_instances, and themetal_text_enabled()hook inpaint_cg.odin). The whole-frame pass covers everything it did without its z-order bug; the atlas, extraction, Metal pipeline, sampler and instance-buffer ring are shared and stay. - 6 new tests (
macos/glyph_run_cache_test.odin: every key field distinguishes, identical keys hash identically past the padding, store/lookup round-trip, a different key misses rather than returning its neighbour, a generation change clears while an unchanged one does not, the cap resets rather than growing;core/theme/theme_test.odin: the version bumps on:themeand:colorand does not bump on a rejected one). - Two harness fixes that came out of trying to verify this, both cases of a check that could not fail.
--render-snapshot-stagenever ran on the GPU capture path — it is only called from the Core Graphics snapshot path — so a staged GPU capture silently showed a plain startup frame. And a GPU capture rendered the first frame, where the cache is still cold, so comparing cache-on against cache-off compared two cold frames and agreed for the wrong reason; captures now drive several frames before arming.
- Instances are stored relative to the run origin, which is what makes a scroll a hit rather than a miss: extraction runs against the origin's subpixel phase alone, and the whole-pixel part is added afterwards. That is exact rather than approximate —
macos: the whole frame can now be drawn by the GPU — rectangles and glyphs as one ordered stream of instanced quads, with no Core Graphics surface involved at all. Newmacos/metal_frame.odinwalks the Painter's command list in order and emits instances: aFill_Rectbecomes a solid quad (the glyph instance format with a negative-UV sentinel the fragment shader reads as full coverage, so rectangles and glyphs are literally the same primitive and need no reserved atlas texel), aText_Atbecomes its glyphs, and a clip becomes a scissor rect — which is what splits the stream into batches, onesetScissorRectand one draw call each. Behind--render-gpu-frame; when it renders a frame,draw_frame_into_contextskips the Core Graphics replay entirely andmetal_draw_frameskips the blit, because the surface holds nothing.- All-or-nothing per frame, and that is a correctness property rather than a simplification. Rendering some commands on the GPU over a Core Graphics frame silently reorders them: glyphs drawn after the blit land on top of a cursor block the command list says covers them — a bug the text-only pass had. A single stream replayed in list order cannot get that wrong. So a list containing a kind this pass cannot draw (strokes, ellipses, wrapped text — floats, diagnostics, debug sessions) falls back to Core Graphics whole.
- Measured on the same machine and display, 46-row full repaint: 3.30 ms through Core Graphics into the window's context, 3.41 ms through the shader pipeline's offscreen bitmap, 3.11 ms with the whole frame on the GPU — 6% under the direct path and 9% under the shader path. Better than the text-only pass (which was a wash) because it removes the full-surface fills rather than adding work beside them, but far short of what the architecture allows: the remaining frame is 1.87 ms of Painter walk plus 1.19 ms of instance building, and both re-derive per frame what almost never changes. The bytes of a row still become an
NSString, then anNSAttributedString, then aCTLine, then glyphs, every frame. Caching the extracted run per row is the multiplier, and it no longer carries the objection that stopped theCTLinecache — a GPU frame is already not pixel-identical to Core Graphics, so there is nothing left to preserve. - One measurement trap worth recording: the first numbers had the GPU path a second slower than it is, because
--render-gpu-frameleft the extraction probe armed and every glyph was walked twice — once by the frame builder, once by the probe. Overlapping instrumentation flags are easy to leave on and hard to see in a result.
macos:make render-check— a pixel-exact render regression harness. Two fixtures undertests/render/are rendered offscreen through the realdraw_frame_into_contextpath and compared against previously captured frames, byte for byte; a single differing pixel fails the target.make render-baselinecaptures references from a known-good build, then the workflow is change, rebuild, check. Thestagedcase carries visual selection, search matches, one diagnostic squiggle per severity, extra cursors, ghost text and an autocomplete float with its side documentation panel, on top of syntax highlighting,set listglyphs, tabs, trailing whitespace, fallback glyphs and a truncated long line; thetabscase covers the tab bar, its separators and the block cursor. Between them that is most of what the renderer draws — and the overlays only appear because--render-snapshot-stagewrites the editor's fields directly, since this surface has no keyboard automation and a startup frame would leave most of the paint paths uncovered. The driver fixes the three things that otherwise produce a confident, meaningless mismatch: it runs against a scratchHOME, copies the fixtures out of the work tree (git-diff stripes and the status-bar branch name are resolved asynchronously, so inside a repo the frame depends on when the subprocess answered), and kills stray editors first — a second live editor means the new window never becomes key, the focused-pane highlights differ, and the entire content area reports as changed. Swap files are cleared between cases, and a missing reference fails rather than passing, so a check can never silently compare against nothing. Verified by regression, not just by passing: a deliberate one-pixel shift of the line-number origin is caught in both cases, with the reportedboundslanding exactly on the gutter column. References (~19 MB of raw BGRA each, and only meaningful for the machine and display that produced them) are captured on demand into the gitignoredmacos/.build/render/rather than committed. Not part ofmake test— it needs a window server and a couple of seconds per case.macos: the buffer text can now be painted by the GPU — instanced textured quads sampling the glyph atlas, blended over the Core Graphics frame in the existing post-process pass. Newmacos/metal_text.odin: a second render pipeline with straight source-alpha blending, a nearest-filter sampler (quads sit at whole device pixels with a size matching their atlas rect, so there is nothing to interpolate and filtering would only soften the glyph), anR8Unormatlas texture uploaded by dirty rect, and a ring of instance buffers grown in lockstep — a per-slot capacity would make the buffer in use depend on which frame last resized, which is the kind of state that produces a wrong frame once in a while. Riding the existing pass rather than owning one is what lets Core Graphics keep painting everything except the text with no CPU/GPU synchronisation over the shared surface;paint_cg.odinskips exactly theText_Atcommands the GPU consumes, so nothing is drawn twice. Quads are placed at the whole-pixel pen with the fractional part selecting the atlas phase, rather than quantising the position — quantising would move glyphs relative to one another by up to half a pixel. Behind--render-glyph-gpu/--render-gpu-capture=<path>; the default path is untouched and both snapshot fixtures still compare byte-identical.- Measured, and it is not faster. Shader mode, 46-row full repaint of a real source file, 2020 glyphs: Core Graphics spends 1.13-1.18 ms in
text_draw_ms, and the GPU path spends 1.00 ms of CPU to replace it —editor_ms3.78-4.03 (CG) against 3.87-4.02 (GPU), i.e. inside the run-to-run noise. Isolating the GPU path's CPU cost by switching each stage off in turn: 0.44 ms layout (the CTLine and run walk), 0.31 ms atlas lookup, 0.26 ms instance emission. GPU time itself is 0.3-0.6 ms and never the constraint. So the rasterisation this was built to remove really does go away — CoreText's 1.15 ms becomes 0 — and it is almost exactly replaced by the CPU work needed to feed the GPU. A direct-mapped front cache ahead of the slot map (added while chasing this) moved the lookup by only 0.05 ms, so the cost is spread across the per-glyph path rather than sitting in one addressable place. Even driving lookup and emission to zero leaves layout at 0.44 ms against CoreText's 1.15 ms — a ~18% frame improvement as the ceiling, which is what the extraction probe predicted before any of this was built. The layout half only disappears behind a shaped-line cache, and that is the thing the earlier CTLine experiment showed is not pixel-identical. The path stays behind its flag. - Verified by capture, not by assertion.
--render-gpu-capturereads the drawable back after the GPU is done with it (which needs the layer to stop being framebuffer-only) and writes it in the snapshot format, so the same tooling compares both ends of the pipeline — the Core Graphics harness renders into its own bitmap and by construction never sees a Metal pass. With Core Graphics still painting the text underneath, the GPU quads landed on the existing glyphs rather than beside them (the difference is glyph-shaped, not two offset copies), which is what confirmed positions, colours and atlas UVs in one measurement. With the CG text suppressed, GPU-only text differs from Core Graphics-only text in 0.98% of pixels, mean delta 17.7/255 — antialiasing, not structure, and far closer than the fallback-font mismatch the CTLine experiment ran into. - Two Metal ordering rules learned the hard way:
presentDrawable:must be requested beforecommit(Metal aborts otherwise, from insideaddScheduledHandler:), so a capture reads back after commit instead; and a drawable refusesgetByteswhile the layer is framebuffer-only, which therefore has to be decided at layer-configuration time rather than at capture time.
- Measured, and it is not faster. Shader mode, 46-row full repaint of a real source file, 2020 glyphs: Core Graphics spends 1.13-1.18 ms in
macos: glyph atlas for the GPU text path — rasterise each glyph once, not once per frame. Newmacos/glyph_atlas.odinkeys an 8-bit coverage texture on(font, glyph, subpixel phase)and hands back the texel rect plus the bearing a quad needs. Removing the per-frame rasterisation is the half of CoreText's cost the GPU can actually take (the other half is layout, which stays on the CPU — see the extraction probe). Two pieces, deliberately split so most of it is testable without a window: the shelf packer is pure arithmetic (best-fit by wasted height, new shelf when nothing fits, explicit exhaustion rather than a clamped — and silently cropped — slot), while rasterisation needs CoreText. Four horizontal subpixel phases rather than whole-pixel rounding: CoreText's glyph positions are fractional, and rounding each one independently shifts glyphs by up to half a pixel relative to one another, which reads as uneven spacing and is the usual tell of a naive GPU text renderer.--render-glyph-atlas=<path>dumps the coverage texture so it can be looked at — a glyph atlas is one of those things where reading the code tells you far less than seeing it, and the dump is what confirmed the fallback glyphs (日本語 → — … ✓ ¶ ·) land unclipped alongside ASCII. 6 new tests for the packer (shelf reuse, opening a shelf when the row is full, least-waste selection, exhaustion and oversize rejection, reset, and the subpixel bucketing including negative positions from horizontal scroll).- Two macOS landmines found the hard way and now recorded in CLAUDE.md. A 4-double struct returned by value does not survive the Odin/C boundary:
CGRectis a homogeneous float aggregate returned inv0-v3on arm64, and bothCTFontGetBoundingRectsForGlyphsthrough aforeignblock and-[NSFont boundingRectForFont]throughmsgSendfault with a corrupted frame. ScalarCGFloatand 2-doubleCGSizereturns are fine, so slot geometry comes fromascender/descender/maximumAdvancementwith deliberate overshoot instead. And a CTLine owns the fonts of its runs — for a fallback font the line may be the only reference, so extracting glyph positions into a buffer and rasterising them after releasing the line is a use-after-free that fires only on lines with fallback glyphs; rasterisation therefore happens inside the run walk, which removes the lifetime question rather than managing it.
- Two macOS landmines found the hard way and now recorded in CLAUDE.md. A 4-double struct returned by value does not survive the Odin/C boundary:
macos: positioned-glyph extraction from the Painter's text commands, and a probe that measures what it costs — the first step of the GPU text path, and the measurement that decides whether the rest of it is worth building. Newmacos/glyph_run.odinwalks a recordedText_Atcommand'sCTLineruns (CTLineGetGlyphRuns/CTRunGetGlyphsPtr/CTRunGetPositionsPtr, with the copyingCTRunGetGlyphsfallback for runs CoreText will not hand over by pointer) and yields(glyph id, device position, colour, font)— everything a textured-quad renderer needs, with CoreText still doing the shaping, so ligatures, fallback fonts, wide glyphs and combining marks are unchanged and the painted glyphs cannot drift from the caret/selection math infont.odin, which measures through the sameCTLine.--render-glyph-proberuns the extraction on every frame after the replay (so it cannot inflatereplay_ms) and reportsgextract_ms,glyphsandgruns; it changes nothing about what is painted. The finding it exists for: on a 46-row full repaint of a real source file (~2030 glyphs), CoreText's whole text draw is 1.14 ms and extraction alone is 0.57 ms — i.e. half of what drawing costs today is layout, which the CPU still has to do after the glyphs move to the GPU. A GPU glyph renderer therefore replaces ~1.14 ms with ~0.57 ms of layout plus atlas and instance-buffer work, saving roughly 0.5 ms of a 3.6 ms frame (~13%), not the ~39% the rawtext_draw_msshare suggests. Scaling is sublinear in glyph count (fontsize 13/9/6 → 2032/3072/4214 glyphs;text_draw_ms1.14/1.15/1.49,gextract_ms0.57/0.70/0.69), because the cost tracks inked pixel area more than glyph count — packing more, smaller glyphs into the same window is nearly free, and it is physically larger or denser displays that make text painting hurt.- The spike's second finding, which cost the shaped-line cache its "pure optimisation" status: drawing a
CTLinedirectly is not pixel-identical to-[NSAttributedString drawAtPoint:]. It needs the flip supplied as an explicit text matrix, and a baseline oftop + ascentlands one device pixel low; correcting that takes a full staged frame from 39226 differing pixels to 3459, and the offset sweep plateaus across [-0.55, -0.4] logical points, i.e. the baseline is being quantised to a device pixel. The 3459 that survive are confined to exactly one row — the line carrying fallback-font glyphs (— → … 日本語 ✓), whose runs do not share the line's ascent — so matching would need per-run baseline handling. Font smoothing and subpixel positioning/quantisation flags were swept and make no difference at all. The row text therefore still goes throughdrawAtPoint:and the frame stays byte-identical;Paint_Cmd_Kind.Text_Line(withCTLineDrawandCGContextSetTextMatrix/SetTextPositionbindings, painter ownership of both the line and its backing string, and a test pinning that ownership) is landed but unrecorded, because it is the piece the next attempt needs and the measurement above is what it cost to get right.CTLineDrawandCGContextSetTextPositionalso moved out oficon.odin's localforeignblocks intodraw_bindings.odinnow that the renderer has a use for them.
- The spike's second finding, which cost the shaped-line cache its "pure optimisation" status: drawing a
macos: the renderer no longer talks to Core Graphics —draw.odinrecords a backend-neutral display list and a backend replays it. Newmacos/paint.odin(thePainter: fill/stroke rect and ellipse, polyline, clip push/pop, text at a point or in a rect) andmacos/paint_cg.odin(the Core Graphics backend). The paint walk indraw.odin+draw_row_helpers.odinnow emits commands — 33CGContextFillRect, the strokes, ellipses, clips and 28 text draws all becamepaint_*calls — and the CG backend is a transcription of what those call sites used to do inline, in the same order with the same arguments. The point is what comes next: painting glyphs on the GPU is a change to how the same list is realised, not to what the editor draws, so a Metal backend becomes a second consumer of this list rather than a second copy of the renderer, and can be diffed against the CG one frame-for-frame. Three properties are load-bearing. Commands are self-contained — colour, stroke width and line join travel with the command instead of being context state set beforehand — so a backend may batch or reorder without inheriting a state machine. The clip mechanism is recorded, not normalised: the frame-level damage clip went throughCGContextSaveGState+ a rect path while the per-pane and per-row clips went throughNSGraphicsContext+NSBezierPath, and those are equivalent in effect but not provably identical at fractional-rect antialiased edges — a seam whose value is that it changed nothing does not get to guess. Text commands own a+1reference to their attributed string, because recording defers the draw past the point the old code released it; ownership transfers at the call site andpaint_resetgives it back, including on a record path that returns early. The replay also tracks clip depth and reconciles it: an unclosed push is popped (and logged once) instead of leaving the context clipped and its gstate stack one deep for every subsequent frame, and a stray pop is dropped rather than restoring a gstate the frame never saved.Render_Editor_Phasesgainedrecord_sec/replay_sec, both surfaced in the benchmark and passive-timing lines;row_otherstopped subtractingtext_draw(glyph painting is no longer insiderow_sec, and subtracting it drove the figure negative wheremax(0, …)hid it), andframe_otheris now the record walk's remainder rather than the whole editor call's.text_draw_mskeeps its name but is measured during replay and now covers every text command — gutter numbers, list glyphs, status line, float rows — where before it timed only the per-row buffer text, so pre-seam benchmark logs are not directly comparable on that one figure. One bug found and fixed during the change, worth knowing about: memoising fill colour across commands is wrong, because-[NSAttributedString drawAtPoint:]sets the context's fill colour from its foreground attribute and leaves it set — a cache of "the colour we last asked for" goes stale behind any text command, and the next fill that believes it is current inherits the glyph colour (it reproduced as an extra cursor's translucent block painting solidcursor_char). The old code was immune because it set the colour before every fill; so is the backend now. Measured on the same fixture, the seam is slightly faster than the direct-call renderer (typing workloadeditor_ms3.334 → 2.970; click 1.579 → 1.489), and it makes the shape of the frame legible for the first time: of 2.97 ms, glyph painting is 1.37 ms (46%) while all other painting — rects, strokes, ellipses, clips — replays in 0.11 ms. 13 new tests (macos/paint_test.odin: recording order and payload fidelity, clip mode/rect capture, clip-depth balance acrosspaint_begin, path point storage and degenerate-run rewind,+1ownership released on reset viaretainCount, nil-string absorption, plus three that replay into an offscreenCGBitmapContextand assert the resulting pixels — clip honoured, leaked clip reconciled, stray pop ignored).macos: an offscreen frame capture that makes renderer changes provable instead of eyeballed. Newmacos/render_snapshot.odin:--render-snapshot=<path>renders one full frame through the ordinarydraw_frame_into_contextpath into a private BGRA bitmap (the same flippedNSGraphicsContextbouncemetal_verify_partial_frameuses, so it is exactly what the window would have shown) and writes it with a 16-byte header;--render-snapshot-compare=<path>renders the same frame and diffs it through the existingmetal_compare_bgra, exiting 0 on an exact match and 1 on any differing pixel, with the mismatch count, bounding box and first differing pixel logged.--render-snapshot-stageforces the focused editor into a state that exercises the overlay paths a plain startup frame never reaches — visual selection, search matches, one diagnostic squiggle per severity, extra cursors, ghost text and an autocomplete float with a side documentation panel — by writing the fields directly, since this surface has no keyboard automation.--render-snapshot-delay=<ms>(default 1500) lets the first file-watch tick settle. The header carries a magic and the dimensions so a compare against a stale or differently-sized reference reports that rather than diffing misaligned rows. This is how the Painter seam above was landed: two fixtures (a rich staged frame and a two-tab frame) captured before the change and compared after, 0 of 4,860,800 pixels differing on each. It is also the intended way to validate a future Metal content backend against the Core Graphics one. 4 new tests (macos/render_snapshot_test.odin: header round-trip and pinned layout, rejection of empty / truncated / wrong-magic / length-disagreeing / zero-sized files, and argument validation).mem/config: all editor memory now comes out of one process-wide pool sized by a newmemorylimitdirective in~/.editor, instead of every editor reserving a 1 GiB arena of its own. Newcore/app_memoryputs Odin'score:mem/tlsfover a single backing region taken once at startup (default 1024 MiB, clamped to 64–3072 — TLSF pools must stay below 4 GiB), andRope_Poolstops being a fixed reservation: it is amem.Dynamic_Arenagrowing in 1 MiB blocks drawn from that pool and returned to it on:e/ destroy, so N panes share one budget instead of reserving N GiB. Ownership tests stayed cheap by indexing the arena's block bases in a sorted array, so_pool_ownsis a binary search rather than a walk of all three block lists on every alloc and free; the block count is a sound validity stamp because the arena's cycling and reset only ever move blocks between lists, never add or drop one. Per-pane scratch is leased throughscratch_acquire/scratch_releasewith an inline 8-slot block cache, allocation-free so it still works while the pool itself is under pressure. Exhaustion is not fatal, by design: the general allocator spills to the OS heap when the pool is full, because it backs rope nodes, undo snapshots and editor state whose call sites write through the returned pointer immediately — a nil return there is a SIGSEGV with the user's unsaved buffer in it, and a self-imposed ceiling must not outrank the user's data. Spilled blocks live outside the region, so the same ownership test routes every later free/resize back to the heap they came from; filling the pool costs locality and exactly oneapp_memoryWARN per process (a log flood is the last thing an out-of-memory process needs).editor_createno longer panics on a failed reservation either: it unwinds and returns nil, whichcore/panetreealready reads as "the split just doesn't happen" — the caller is usually a:vsp, and aborting would take every unsaved buffer with it. File loads are the one path that declines outright ("not enough editor memory (see:help memorylimit)"), since a whole file has to be read at once. The C-shapedmalloc/calloc/realloc/freehelpers for frontend I/O buffers carry a magic-stamped header and deliberately never spill, which is what keeps ownership an exact pool/foreign discriminator — foreign pointers fall through tolibc.free.initializepublishes its ready flag last so the steady-state path skips the mutex entirely, and the tracker is built under the lock before that publish becausemem.tracking_allocator_initwould re-enter the allocator and deadlock on it. Which brings the second half:-define:ODIN_TEST_FAIL_ON_BAD_MEMORYhad been checking an empty set, since editor memory never passes throughcontext.allocator. Routingallocator()at the runner's tracker would have been worse — it is per worker thread, reset and freed between tests, so process-global state (pane tree, plugin registry,g_reg_text) would be freed out from under later tests, the exact dangling-global trap CLAUDE.md documents — sotracking.odinwraps the pool instead, indifferent to test boundaries, and logs a bad free at.Errorthe moment it happens rather than letting it vanish. Wiring:memorylimitis read once byconfig.read_memory_limit_mbbefore plugin scanning and the first pane allocation (all three frontends' bootstrap pluscore/host.create_pane_tree), filtered out ofread_apply_linesbecause it cannot take effect mid-session, malformed values fall back to the default and out-of-range ones are clamped, and the range constants alias the pool's own so there is one set of numbers. The rest of the tree moved offruntime.heap_allocator()/libc.malloconto the pool — LSP/DAP/Flutter/chat receive buffers, plugin registry and vtable (no ABI change), marks, files cache, pane tree, script, and every frontend's clipboard, file I/O and subprocess plumbing. Newmake testruns all 30 core suites with-define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true(single-threaded for the suites that share process globals). 6 new tests:core/app_memory(spill past the limit and free correctly, bad free recorded and not forwarded to TLSF, C-helper resize/free, scratch block reuse) plus residue tests incore/editorandcore/panetreethat mark the pool and assert a full editor / pane-tree lifecycle gives every byte back. README and help.md document the directive, including that it sizes the region the editor prefers to work inside, not a wall it dies against.editor/buffer: soft wrap no longer truncates — a file that is one enormous line (minified JS/JSON, a base64 blob) is fully viewable and scrollable, and painting it is affordable. The per-line byte cap stopped being a caller parameter and moved intocore/buffer/rowplan.odinasline_render_cap(wrap_cols), because the two wrap modes bound fundamentally different costs: with wrap off the whole line goes into one Pango/CoreText/DirectWrite layout and shaping is superlinear, so a pathological line must be cut (8 KiB, far past any pane's visible columns); with wrap on every painted row is at mostwrap_colscells, so a byte cap buys nothing and only makes the tail of a long line unreachable — no visual rows were emitted for it at all. That divergence was also a correctness bug: the renderers capped,cursor.odin's wrap math never did, and the two disagreed about how many rows a long line had. Uncapping is only affordable because the cost moved: each logical line is now fetched once per frame rather than once per visual row, and all three renderers gained a per-logical-line syntax memo — the lexer classifies a whole line at a time (an earlier//or unclosed quote decides how the rest reads) while the paint walk emits one visual row at a time, so a 39 KB minified line across 60 sub-rows was re-lexed per row, ~2.3 MB of lexing every frame. One memo slot is enough because a line's sub-rows are contiguous in the row plan, and the cross-line block-comment state still advances exactly once per line because the memo misses precisely on the first sub-row. The span buffer grows instead of saturating (core/syntax's_pushsilently drops spans once full, so the old fixed 512 meant a minified line lost all colour a few hundred bytes in). The caret and extra-cursor layouts stopped handing the text engine an open-endedline[seg_start:]tail — on a single-line file that is the entire file, every frame — and now bound the slice withwrap.visual_row_advance. Truncation became visible rather than silent:Row.truncatedrides the last sub-row and the renderers paint a dim⋯at the cut (reachable only with wrap off).rope_get_line_cappedalso halves its request until it fits instead of returning an empty slice the renderers would faithfully paint as a blank row, and trims a trailing partial UTF-8 sequence — the cut is a raw byte count, andNSString initWithBytes:length:encoding:UTF8returns nil for invalid UTF-8, blanking the whole row on macOS instead of substituting a replacement glyph. Scrolling grew the matching wrap arms:editor_scroll_linesused the logical-line path, which clamps torope_line_count - 1and never touchesscroll_subrow, so the wheel stepped over the interior sub-rows of every wrapped line — and on a one-line file clamped to 0, making it a complete no-op — whileeditor_center_on_linesnapped to a long wrapped line's first sub-row for the same reason.SCRATCH_SIZEwent 512 KiB → 8 MiB, since one whole logical line is now fetched into it andrope_get_line_cappeddegrades to a marked truncation past that. 8 new tests (core/buffer/longline_test.odin: the cap policy per mode, UTF-8 boundary trim, the iterator spanning a long wrapped line and resuming past the old cap, non-wrap still capped, and row-plan/cursor row-count agreement; plus twoeditor_scroll_linestests for movement inside a single wrapped line and unchanged non-wrap behaviour). help.md's wrap section was rewritten — its "v1 skip list" was stale and now names only bracket-match highlighting. AddsAGENTS.md(repo layout, build/test commands, style and PR conventions).syntax/assoc: the editor can register itself with the OS as a handler for the source files it highlights —:assoc/:assoc-removein the editor,make assoc/make unassocfrom a source tree — on all three platforms. The enabling change is a single canonical table:EXTENSIONSincore/syntax/syntax.odin, one row per extension carryingLang, display name, MIME type, LSP languageId, macOS UTI,mime_own/uti_ownownership flags, and anAssoctier. It replaces four hand-copied extension lists that had already drifted three ways —detect_langknew.hxxbut not.hh,lang_for_pathknew.hhbut not.hxxand was case-sensitive (soMAIN.Csilently got no LSP), and_comment_syntaxkept a third copy that omitted YAML entirely, makinggca no-op in.yamlfiles. All three now derive from the table, which fixes those in passing:.hh/.hxxboth highlight and get clangd,lang_for_pathfolds case, andgccomments YAML with#. The ext→Langmapping is the only thing keyed by extension; per-language facts (comment delimiters, keyword tables) switch onLanginstead, and the header states that two-level rule so the next language doesn't reintroduce a fifth list._ext_loweralso stops the scan at the last path separator, so/opt/v1.2/Makefileno longer reports an extension of2/Makefile. Newcore/assocholds every generated artifact as pure, allocation-explicit text — the Linux.desktopbody, the shared-mime-info XML, the macOSInfo.plist, and themimeapps.listmerge/strip — deliberately out of the platform directories so the riskiest logic is unit-testable on any host; the three frontends own only I/O. Linux (linux/assoc.odin,--export-desktop/--export-mime-xml/--register-assoc) installs three separable layers — a shared-mime-info package so.odin/.gpr/.jsxare recognised at all,MimeType=in the.desktopso the editor is offered, and[Default Applications]inmimeapps.list— and only the third is ever written by:assoc;make install-linuxstops at layer 2, so installing never changes which app owns a file type. Both Makefileprintfheredocs that used to hand-write the.desktopare gone (theMimeType=line would have been a fifth copy of the extension list). Removal rewritesmimeapps.listline-by-line, deleting only our own desktop id and preserving every other application's entries, comments, sections and ordering byte-for-byte — pinned by a round-trip test asserting register-then-remove restores a foreign config exactly.update-mime-databaseis spawned fire-and-forget because it takes 1–2 s and would otherwise trip the UI-thread watchdog, and_self_exec_pathprefers$APPIMAGEover/proc/self/exe(which inside a running AppImage points at a/tmp/.mount_…FUSE path that vanishes at exit) and refuses to persist such a path at all. Windows (windows/assoc.odin) writes per-language ProgIDs, per-extensionOpenWithProgids, and aRegisteredApplications/Capabilitiesblock underHKCUonly — no admin rights, and deliberately neverFileExts\…\UserChoice, whose salted hash Windows will not accept from an application; the user picks the default once from Explorer or Settings. Two details are load-bearing: the(Default)value ofClasses\.<ext>is never set (the HKCR merge is per-value, so a key holding onlyOpenWithProgidsdoesn't shadow HKLM's type, but setting its default would hijack it), and removal deletes only our own value then drops the key only ifRegQueryInfoKeyWreports it empty — verified by seeding a foreignVSCode.cppentry and confirming it survives. Sinceeditor.execarries no PE resource,DefaultIconresolves to nothing; rather than commit a binary.ico,icon.odingrew an ICO serialiser that writes{256,48,32,16}from the existing runtime GDI renderer to%LOCALAPPDATA%\Editor\editor.ico, keeping the repo's "icons are drawn, not shipped" convention. macOS gains a realEditor.app(make bundle-mac) — Finder can never associate a bare binary.Info.plistis emitted by the binary (--emit-info-plist) because itsCFBundleDocumentTypesmust trackEXTENSIONS; every type declares bothCFBundleTypeExtensionsandLSItemContentTypes(the UTI list is what LaunchServices matches, the extension list is what makes it synthesise a dynamic UTI for undeclared types), types with no system UTI are declared underUTImportedTypeDeclarations— imported, never exported, which would claim to define languages we merely edit — and every entry ranksAlternate, neverOwner/Default, which still wins outright for types nothing else claims (.odin,.dart,.rs) while leaving Xcode's.calone..tsis left to the extension path rather than claimingpublic.mpeg-2-transport-stream.application:openFiles:is wired viaclass_addMethod, and because a cold Finder launch delivers it insidefinishLaunching— beforeapplicationDidFinishLaunching:and therefore before the pane tree exists — it buffers intog_pending_filesuntilg_launched; a warm open dedupes against already-open buffers, since double-clicking one file twice would otherwise give two buffers over one file and put the file watcher and swap machinery into a split-brain state.install-macnow ships the bundle to~/Applicationswith a~/.local/bin/editorsymlink (a copy would breakchat_proc.odin'sdirname(realpath(_NSGetExecutablePath()))lookup ofeditor-perm-helper), and CI signs inside-out — never--deep, which would hand the helper the app'sdisable-library-validationentitlement — signing the bundle so_CodeSignature/CodeResourcesseals the plist and icon, and packages withditto -c -kinstead of tar. 29 new tests (core/syntax/ext_table_test.odin: lowercase/unique/length/non-empty-mime-uti invariants,detect_langagreement in both cases, separator-aware negatives, and thehh/hxxregression;core/assoc/assoc_test.odin: tier separation,.desktopshape, mime-XML never redefining a system type, plist rank/ownership policy and full extension coverage,mimeapps.listforeign-entry preservation, idempotency, and the register→remove round-trip). One bug the XML validator caught that tag-counting had not: both generators embedded a CLI flag name in an XML comment, and--is illegal inside one —plutilandupdate-mime-databasereject the whole file for it; there is now a test for that specifically.panetree: floating utility panes are movable and resizable — drag one by its status bar, drag its border to resize, or drive it from the keyboard. Float rects used to be pure derivation:_float_rectrebuilt them every frame from hardcoded per-role fractions, so nothing about a float's place was state and the eightCtrl+Wmove/resize chords were hard no-ops under float focus.Float_Entrygainedplaced+fx/fy/fw/fh, and_float_rectsplit into a dispatcher over the untouched-verbatim_float_role_rectand a new pure_rect_from_frac. Geometry is stored as fractions of the content rect (new_content_x/y/w/honPane_Tree, stamped bycompute_layoutbeside_status_hand deliberately not cleared by_invalidate_caches— it describes the window, not the tree), so a window resize scales floats proportionally and a hide/show round-trip restores them unchanged; clamping runs at both mutation time (pixels, prevents rect inversion) and derivation time (the content rect may have changed since), and_rect_from_fracnever writes back — a clamp that rewrote the fractions would leave a float squashed for the rest of the session once the window was briefly shrunk. Floats stay fully inside the content rect, because the move handle is the float's own bottom status bar and an escaping bottom edge would strand it unmovable. Newcore/panetree/float_drag.odinholds the mouse machine — aFloat_Regionhit test (FLOAT_GRAB :: 5bands strictly inside the rect, so "everything a float claims lies inside the rectfloat_at_pointreports" still holds; occlusion resolved by rect, not region, or a click in the middle of the chat float would resize the results float behind it; the mid-bottom band stays Move because the 5px band would otherwise eat a quarter of the only handle users reach for, leaving height to the top edge and the two bottom corners) plus a begin/update/end lifecycle living in core for the same reasonsdrag.odindoes. Two subtleties are load-bearing and pinned by tests:float_drag_beginhit-tests, snapshots, then raises, because_float_show_entryinvalidates the layout cache unconditionally (unlike tiledfocus_editor, which only invalidates when raising a background buffer) — after arming, update runs purely off the snapshot plus_content_*; and the drag is keyed on^ed.Editor, never a float index, becausefloat_closecompacts_floatsand a stale index would silently start moving a different, live float. Nothing indrag.odinwas relaxed — the float machine is parallel and additive, anddrag_begingained a third guard refusing to arm while a float drag runs. Keyboard:move_focused/resize_focusedretarget onto the float instead of returning early (bothabsorb_actiontables inherit this for free — they call the same core procs), and newCtrl+W =/:float reset(Action117,FloatReset,:map-bindable) drops a placement, without which one stray drag would detach a singleton-role float from its default for the whole process. Frontends stay thin — press/motion/release forwarding plus cursor shape, and no new frontend state at all: unlike the tiled drag, which rearranges the tree on drop and needs a movement threshold before arming, a float drag is a no-op if the pointer never moves, so the dead-zone lives in core andwindows/app_state.odin's ~65#assert(offset_of)pins are untouched. Cursors: Windows has the complete set, Linux gainedNWSE_RESIZE/NESW_RESIZEthroughUiCursor/WinCursor(X11XC_bottom_{right,left}_corner; the Wayland shape constants were already in-tree for CSD edge resize), and macOS registers float bands inresetCursorRectsalongside the separators — open hand for the move handle and crosshair for corners, since AppKit publishes neither anNSCursor.movenor a diagonal resize cursor and the private_windowResize*selectors are off-limits. Consequences: a hand-placed[dbg output]no longer shortens itself above the debug strip, and the three debug columns move independently. Placements are session-only — floats were already excluded from.editor.prjby construction and nothing new is written to~/.editor. 19 newcore/panetree/float_geom_test.odintests (proportional rescale, the no-write-back geometry-rot lock, containment and tiny-window degradation, keyboard saturation, the region band table, occlusion, drag-survives-invalidation, resize-never-inverts, close-during-drag, and a four-float compaction test proving the drag is editor-keyed);floating_test.odin's structural-noop test split, since move/resize are no longer no-ops there. help.md's Panes and Floating utility panes sections rewritten — the latter previously documented the exact opposite.
0.0.32
Added
ci: macOS release binaries are now Developer ID-signed. Thebuildworkflow's macOS job gained aCodesign (Developer ID)step between build and package: it materialises the cert from two new repo secrets (APPLE_CERT_P12base64 +APPLE_CERT_PASSWORD) into a throwaway keychain — plus Apple's G1 "Developer ID Certification Authority" intermediate curled from apple.com, because the p12 is leaf-only and a runner keychain without the issuer makes codesign die witherrSecInternalComponent(the leaf's AKI pins G1, not G2; both leaf and G1 expire 2027-02-01, so the re-issued cert will want the G2.cerinstead) — auto-discovers the "Developer ID Application" identity, and signs botheditorandeditor-perm-helperwith--options runtime --timestampand explicit stable identifiers (com.pawsm.editor,com.pawsm.editor-perm-helper— otherwise codesign derives the TCC-relevant identifier from the generic filename) — hardened runtime + secure timestamp now so notarization can bolt on later as one extra step (deliberately deferred; unnotarized Developer ID downloads may still warn on quarantine-carrying paths, butcurl+tarinstalls don't set quarantine). The main binary signs against newmacos/editor.entitlementscarryingcom.apple.security.cs.disable-library-validation, without which the hardened runtime would reject every native plugin dylib not signed with the same Team ID (core/pluginloads arbitrary user libraries by design). Ordering matters and is pinned by a comment: signing runs afterrelease-mac'sstrip -x(stripping after signing invalidates the signature), and the signature lives in the Mach-OLC_CODE_SIGNATUREload command so the existing tar packaging ships it unchanged. The step is guarded by a job-levelHAVE_APPLE_CERTenv check, so forks and secretless dispatch runs still produce an (adhoc-signed) build instead of failing; nospctl --assessin CI since it rejects unnotarized Developer ID binaries by design.
0.0.31
Added
ci: ARM64 Linux release builds — thebuildworkflow gained alinux-arm64job on theubuntu-24.04-armstandard GitHub-hosted runner (available in private repos since 2026-01), producingeditor-linux-arm64.tar.gzalongside the existing x86_64/macOS/Windows artifacts on every release. One code fix was needed:core/lua/lua.odinarch-gated its Linux foreign import onODIN_ARCH == .amd64, sending every other arch into thesystem:lua5.4fallback — the first arm64 run died at link withcannot find -llua5.4(no runner has a system Lua). The gate is dropped:make deps-linuxbuildsliblua54.anatively on whatever host runs it, so the same in-tree path holds an aarch64 archive on the ARM runner. Everything else worked unchanged: Odin shipsodin-linux-arm64release tarballs and the pinned setup-odin resolves the asset offos.arch(); the Makefile'sAPPIMAGE_ARCH(uname -m) resolves toaarch64, for which linuxdeploy and appimagetool both publish continuous builds, somake release-linux(incl. the AppImage) runs as-is. The whole Linux frontend + core type-checks clean for-target:linux_arm64(wayland-stub recipe from the Mac;odin checkdoesn't require the archive to exist, so the Mac cross-check recipe survives the import change). An ARM64 Windows build was investigated and is not currently possible: Odin has nowindows_arm64target ("Unknown target" on dev-2026-07, the same compiler CI pins) and no native ARM64 Windows compiler build — odin-lang/Odin#6686 tracks both, and a comment in build.yml marks where the twin job goes when it closes. ARM Windows users run the x86_64editor.exeunder Windows-on-ARM emulation in the meantime.
0.0.30
Added
syntax/lsp: HTML, CSS, JavaScript & TypeScript support — highlighting, LSP servers, comment toggle, and vindent, with<script>/<style>bodies inside HTML highlighted as real JS/CSS. NewLangvaluesHtml/Css/Js/Ts(extensionshtml/htm,css,js/mjs/cjs/jsx,ts/tsx/mts/cts). The generic C-like lexer was extracted into_highlight_code, runnable over a line segment — which is how HTML delegates:_highlight_htmlscans for a case-blind</script>/</style>, runs the JS/CSS lexer over the segment, and shifts the produced spans back into line coordinates. Cross-line state (an embedded/* */, a JS template literal) rides the existing single per-line state byte: bits 0–1 keep the same layout as standalone JS/CSS so delegation passes them through verbatim, bits 2–4 pack the HTML context (markup/script/style + unterminated multi-line open tag). The close scan is state-blind on purpose — per the HTML script-data rule,</script>inside a JS string really does end the element.STATE_JS_TEMPLATEdeliberately aliasesSTATE_ODIN_RAW_STRso vindent's raw-string guard protects template-literal interiors for free (the same aliasing on CSS's in-block bit is why CSS is excluded from vindent; JS/TS joined_vindent_lang_ok, HTML stays out as markup). JS and TS keyword tables are split so plain.jsnever paints TS-only words. LSP:vscode-html-language-server/vscode-css-language-server/typescript-language-serverServer_Configentries +lang_for_pathcases incl. the react variants. Comment toggle grew a new capability:_line_comment_prefixbecame_comment_syntaxreturning(prefix, suffix), and a non-empty suffix makesgcwrap each line —/* … */for CSS,<!-- … -->for HTML — with symmetric unwrap (suffix span deleted before the prefix span so offsets stay valid; extension matching case-folded). 34 new tests:core/syntax/web_test.odin(21 — span-exact JS/CSS/HTML pins incl. delegation coordinate shifts, multi-line<scriptpending context, the state-blind close),syntax_cache_web_test.odin(4 — state carry through the editor's per-line cache),comment_toggle_test.odin(8 — byte-identical//legacy pins + CSS/HTML wrap round-trips), and an lsplang_for_path/server_id_for_langtable test. help.md (gc / vindent / LSP server map / extension lists + npm install note), README, and CLAUDE.md's add-a-language checklist updated.panetree: utility panes — debug, grep/results, chat, shell, and flutter output — are now true floating panes that hover above the tiles instead of stealing splits. Every utility surface ([grep],[search results],[diagnostics],[references],[symbols],[breakpoints],[marks],[diff],[space menu],[chat],[! cmd],[flutter run]/[dart run],[flutter devices], the dbg strip +[dbg output]/[value]) used tosplit(.HSplit)a tile; they now live in a 16-slot registry (core/panetree/floating.odin) outside the tab tree, hosting real Editors, appended after the tiles incompute_layoutin ascending-MRU order so the paint loop draws the top float last (drop shadow + 1px border on all three frontends; per-role rects — bottom band for results/shell/flutter, right column for chat, three-column bottom strip for dbg, centered for value/pickers). Unchanged from the user's side: keys route to a focused float normally,Ctrl+W w/h/j/k/lreach floats, clicking focuses and raises,q/Esc/:bddestroy. New:Ctrl+W u/:floattoggles the MRU float;:float results|chat|proc|dbgtoggle per family — hiding never destroys: a hidden chat keeps streaming, hidden debug panes keep updating (:dbg paneschanged meaning accordingly — hide/show, not close-and-recreate).all_editors/contains_editorinclude floats — hidden ones first, because the chat/shell reapers treat absence from that list as "pane died" and a float truncated off a small caller buffer would get its live session reaped. Floats are excluded from.editor.prjby construction, andproject.loadgrew_prune_virtual_leavesso pre-float project files carrying[grep]/[chat]/[stack]leaves replay cleanly (the pre-order split stream is folded into a temp tree, pruned bottom-up — a split with one pruned child collapses to the survivor — and re-emitted). Structural pane commands (split, move, swap, resize) are no-ops while a float holds focus;collapse_to_single_leafspares a focused float (a:project loadtyped in chat executes under that float's allocators — destroying it would free the arena the command runs from). Fixed in passing: the space-menu select path was a read-after-free (close-then-accept became accept-then-close on all three frontends). 11 newcore/panetree/floating_test.odintests + 5 newcore/projectprune/exclusion tests; help.md gained a Floating utility panes section.panetree: drag panes to rearrange — grab a pane by its status bar; edge drops split, centre drops merge into a tab group — and panes can now hold up to 8 buffers behind a per-pane tab strip. Newcore/panetree/drag.odinstate machine living entirely in core (frontends only forward press/motion/release — hit tests, zone geometry, and commit are identical everywhere, same rationale asdrag_sep): a press on the status bar arms, the half-cell motion threshold promotes (a plain click still just focuses), five drop zones per target (30% edge bands → VSplit/HSplit at ratio 0.5, middle band → tab group), a drop-target overlay previews the result (accent fill at 0.22 alpha + 2px outline — the half the target would give up, or the whole pane for a centre drop), releasing outside every pane cancels, and any tree mutation abandons a live drag. Guards:_already_placedstops a no-op edge drop from silently resetting the split ratio; a lone pane holding a lone buffer never arms; dropping a grouped pane onto its own edge tears the visible buffer out into a new split beside itself. Tab groups:Pane.leafbecame an 8-slot buffer group (MAX_LEAF_BUFS) with a tab strip across the pane top rendered only past one buffer — single-buffer panes are byte-identical to before, andLayout_Entry.strip_hcarves the strip off the top so downstream row walks and hit tests need no strip arithmetic. Click a cell to raise,Ctrl+W n/p(:bn/:bnext,:bp/:bprev) cycle,:bd/Ctrl+W qnow peel one buffer at a time (pane closes on the last), andall_editors/LSP sync/file-watch enumerate background group buffers too..editor.prjbumped toFORMAT_VERSION 2with additivebuf/buf-activelines — v1 files load unchanged, and a new side-effect-free_peek_versionpre-scan refuses a file from a newer editor before touching the live layout; fold save/restore covers every buffer in a group. Drag cursor: Linux new.GRAB(X11XC_fleur, Wayland cursor-shape GRABBING), WindowsIDC_SIZEALL, macOS unchanged. Both mirrored layout structs gained#assert(size_of ==)pins so aLayout_Entryfield added without a frontend mirror is a build error. 15 newcore/panetree/drag_test.odintests (zone bands tile exactly, no-op ratio preservation, sibling-promotion reparent, centre merge unlinks the source, tear-off, cancel-on-mutation) + 3core/projectgroup round-trip/version tests; help.md gained Dragging panes + Tab groups sections.editor: Ctrl+click (Cmd+click on macOS) jumps to definition, with a hover affordance — hold the modifier and the identifier under the pointer gets an underline and a hand cursor. Newcore/editor/link_hint.odin: a process-global singleton (one pointer ⇒ one hint — a global can't leave a stale underline in an unfocused pane) armed by the frontends' pointer hit-tests and read back per pane by the three renderers (1px underline in the newlink_underlinetheme role, defaulted in all five palettes to the theme's function colour) and the window layers (hand cursor — X11XC_hand2, Wayland cursor-shape POINTER,NSCursor pointingHandCursorvia cursor rects,IDC_HAND). The hint arms only when the buffer has some way to answer — a Ready LSP server (asked fresh each time, so it flips on when the server finishes initializing) or atagsfile within 8 parent dirs (memoised per editor) vialink_lsp_hook/link_tags_hookwired incore/host— and never on operators, punctuation, past-EOL, or inline-diff virtual rows;editor_note_mutation/editor_destroy/editor_set_filenameall invalidate it. The click goes through the exactCtrl+]path: the.GotoDefinitionbody hoisted into publiceditor_goto_definition(installs the editor's allocators itself — mouse paths arrive with whatever context the frontend had), LSP first then ctags, pre-jump position pushed forCtrl+T. Cmd not Ctrl on macOS because AppKit treats Ctrl+click as right-click; Alt-qualified everywhere so Ctrl/Cmd+Alt+Click keeps the multicursor chord. Frontends fire on modifier transitions (new mods callbacks on both Linux backends; Waylandptr_motionnow fills mods from the seat keyboard's xkb state — wl_pointer carries none, so the hint could never have armed there), and redraw economy is thechangedreturn: motion within the same identifier repaints nothing. A follow-up commit cut the click latency:lsp_proc_try_definitionon all three frontends now ensures servers + syncs documents before asking — the mouse path never ranafter_key's sync, so on a freshly-opened buffer LSP reported no document and the jump fell through to a synchronous whole-tags-file scan on the UI thread — and the Windows hover path stopped re-hit-testing per event (position dedupe onWM_MOUSEMOVE, Ctrl auto-repeat filtered via lParam bit 30, a per-frame gutter-width cache, oneclick_resolvewalk instead of two, and a reusable measuringIDWriteTextLayoutkeyed on segment + font version, mirroring Linux's persistent Pango layout). 5 new tests incore/editor/link_hint_test.odin(word-range byte math past wide glyphs; the singleton lifecycle deliberately one test — the parallel runner would race the global); help.md gained a Ctrl+Click to definition section.editor: inline diff view —:diffexpands the git gutter into the buffer: deleted base lines render inline as red virtual rows (-gutter, dimmed text) at the spot they were removed, added/modified rows tint, and the buffer stays editable with the diff recomputing live per keystroke. Command family::diff(per-pane toggle; survives:e/reload while file-specific base + collapse state reset via neweditor_diff_rebase),:diff <rev>/:diff <path>re-base the diff and gutter onto any git revision or an on-disk file (plain read, no git; existing-file check decides which),:diff all(repo-widegit diff --name-status <base>listing in a[diff]results pane — newPickerKind.DiffList; Enter opens the file with the pane's base applied and the inline view on),:diff off. Hunk motions]c/[c(newPendingRBracket/PendingLBracketchords —]/[were unbound — wrap liken/Nand work with the view off),ghtoggles the hunk at the cursor, and clicking a hunk's gutter stripe/wedge toggles it (view off → enables the view revealing just that hunk). Architecture:core/gitdiffhunks now carry old-side ranges (old_start/old_endinto the retainedhead_lines; Deleted hunks store the lossless gap row — top-of-file deletions above line 0 vs 1 no longer collide — with the gutter wedge derived viahunk_wedge_row, rendering bit-identical); newcore/buffer/vrows.odinprovider (anchor-sorted blocks + prefix sums, O(log n) range counts; the folds pattern's additive dual — nil pointer ⇒ historical behaviour in every consumer) is rebuilt from hunks bycore/editor/inline_diff.odin'seditor_gitdiff_frame_sync, now the single once-per-pane-per-frame gitdiff sync on all three frontends (macOS/Windows previously ranensure_freshper visible row); and newcore/buffer/rowplan.odinRow_Iterbecomes THE definition of line→visual-row layout (folds skip + wrap split + virtual-row injection): the Linux paint walk, macOScompute_visual_segments(VisualSeggainedvirt_idx), BOTH Windows walks (text and the diagnostics re-walk, same commit so squiggles can't drift), and the core pixel↔row mappers all consume it — landed first as a pure refactor proven pixel-identical by screenshot compare against a pre-change build. Scroll: newCursor.scroll_virtlets the viewport top rest INSIDE a virtual block (counted from the block's bottom, so a re-diff that shrinks the block clamps while staying glued to the same real line), threaded through_scroll_top_advance/_visual_rows_from_top/_cursor_visual_row_offsetand the clamps in both wrap and non-wrap modes, including a top parked in an EOF block (scroll_row == line_count); the wheel traverses blocks row by row; a provider rebuild re-runs the keep-cursor-visible correction so async base arrival can't strand the cursor off-screen;editor_pixel_y_to_rowsubgrew avirtreturn and clicks on virtual rows snap to the anchor line.Foldsgained aversioncounter (bumped by all five mutators) so fold changes invalidate the provider with one compare per frame. Theme rolesgitdiff_add_bg/gitdiff_del_bg/gitdiff_old_fgadded to all five palettes and:color. Per-hunk collapse keyed byHunk.old_start(stable while the base is frozen; hunk merges may silently re-expand — cosmetic, documented). Space menu rows, completion vocab (drift-test pinned, incl. thediff x→ revision fallback), and a rewritten help.md Git Diff section. v1 limits: virtual rows don't wrap and render plain (no syntax highlighting), H/M/L and Ctrl+D/U operate on real rows only.
editor: file explorer sidebar —\/:treetoggles an nvim-tree-style[tree]pane on the left edge, with expand/collapse, open-into-main-pane, and create/rename/delete. Newcore/filetree/package following the debug-pane shape: a pure,odin test-able model (flat pre-flattenedNodelist withdepth/expanded, lazy per-directoryos.read_directory_by_pathscans, dirs-first case-insensitive sort, dotfiles shown) plus orchestration that renders the tree as plain text into a Results-mode buffer (picker_kind = .FileTreeselects the new_file_tree_bindingstable; remap via mode tokenfile-tree/ft). The sidebar is a real pane: newpanetree.open_left_sidebar(ratio)wraps the tab root in a VSplit with a fresh leaf on the left at 22%. Enter on a file resolves its target like nvim-tree — a pane already showing the file wins (any tab), then the most-recent non-tree pane, then any non-Results pane, splitting one off only when the tree is alone — and never replaces a dirty buffer; loading goes through theproject_pkg.load_file_into_editorhost hook, so LSP did_open/git-diff/swap semantics come free with zero frontend code. File ops reuse the cmdline as their confirmation UI:a/r/dprefill:tree-add <dir>//:tree-rename <rel>/:tree-delete <rel>via neweditor_cmdline_prefill(acmd_from_resultsflag — mirror ofsearch_from_results— returns the pane to Results after execute/cancel), Enter on the visible command executes; trailing/creates a directory (parents auto-created), delete requires the typed path to match the row under the cursor and refuses non-empty directories unless:tree-delete!.Rrescans preserving the expanded set and cursor row; toggle-off works from any pane and restores focus. Frontends carry only the ~13-line Action dispatch each (linux/macos/windowsactions.odin);"[tree]"maps toLang.Resultsfor rendering, and:tree*joined the completion vocab + space menu. Follow-ups deferred: dir-name coloring (dedicatedLang.FileTree), double-click-to-open, gitignore filtering.editor: search-match highlighting everywhere —:grep/:find/:Find/*set the pattern, results panes and jump targets light up,/highlights live while typing, and wrap mode paints matches./already highlighted committed matches on all three frontends frome.search_pat, but grep/find never set a pattern anywhere and/only lit up after Enter. New core helpers incore/editor/editor.odin:editor_set_search_pattern(clamped fixed-array copy, allocation-free),editor_active_search_pattern(returns the live cmdline whilee.mode == .Searchwith a non-empty prompt, else the committed pattern — the mode gate is what keeps:typing from highlighting despite/and:sharinge.cmdline, and makes Esc-restore fall out for free sinceSearchCancelnever touchedsearch_pat), andpending_search+editor_take_pending_search(mirrorspending_file).:find/:Find/:grep(_exec_command— the single funnel for typed cmdline, picker accept, and command palette) and*/#(.FindUnderCursor) now set the pattern on the invoking editor; the three frontends' results-pane splice helpers set it on the freshly created[grep]/[search results]editor, which lights up the matched substrings via the existing per-row highlighter with zero new render code (n/Nstep through matches inside the pane as a bonus);_parse_result_linestages the results editor's own pattern (so an in-pane/re-search follows the jump, and pattern-less panes like[diagnostics]propagate nothing), and each frontend's GotoFile handler applies it at all three destinations (existing editor in any tab / new tab / focused fall-through), never clobbering with empty. Renderers switched their pattern source toeditor_active_search_pattern: Linux was a one-line swap, macOS deletededitor_get_search_pattern_coutright — its malloc'd cstring was never freed, a per-pane per-frame leak, Windows kept the cstring/free contract and changed only the shim body (type-check-only from this box). Wrap mode: thewrap_cols == 0gate is gone on all three frontends — each row scan now walks the full logical line and paints every hit's overlap with the current visual segment using segment-relative pixel math (same convention as wrap selection: macOSdraw_search_matchestakes(full, seg_base, seg), Linux gotpane_paint_search_matches_wraploading the segment slice into the Pango layout, Windows clamps its_strstrscan to[seg_start, seg_end)measuring againstlt[seg_start:]); non-wrap passes the whole line as the segment so the clamp is a no-op, and a match spanning the wrap break paints its head and tail on both rows. Known cosmetic: theGrep:/Search:header row and pattern-containing path components also highlight in results panes. Newcore/editor/search_highlight_test.odin(grep/find set the pattern, result-row jumps stage + clear pending, active-pattern mode gating incl. the:-shares-cmdline pin,*sets the pattern); help.md updated (search section,#/*, results pane, wrap notes — search highlight removed from the wrap v1 skip list).
Fixed
macos/buffer: leak sweep — per-frame NSString churn on macOS and the rope's per-edit arena drip, plus a batch of teardown/error-path leaks. macOS:ns_string_from_slicereturned a +1-owned NSString while its cstring sibling returned autoreleased — the renderer calls it once per visual row per frame across ~20draw_string_atsites, and exactly one remembered to release. It now autoreleases (the ownership contract is uniform, the leak unrepresentable),draw_frame_into_contextpushes/pops an explicit autorelease pool per frame (AppKit drains its own only once per event-loop turn, so the high-water mark scaled with rows-per-frame),draw_truncatingreleases its per-picker-rowNSMutableParagraphStyle, and the 512×512 dock icon stops leaking. Rope:_try_merge_leavesbuilt merged leaves through a scratch buffer sized underMAX_LEAF— matching neither pool freelist class, it fell through to the arena, whose free is a no-op, permanently burning ~200 B per edit (up to 512 B per merge) until:e. It now allocates the leaf in place at capMAX_LEAF, landing in (and returning to) the leaf freelist, andnewlinesis summed exactly instead of rescanned. Also in the sweep: newhost.shutdown_globals()process-exit teardown on all three frontends (dbg locals/watches/breakpoints, LSP doc-version table, files cache, LSP server overrides, plugin registry —shutdown_allis now idempotent and frees its heap clones); DAPvariableshandlers stop dropping 3 strings per child on the routine stale-index rejection; LSP_failclearssem_request_uris(one leaked URI per keystroke batch against a dying server) andclose_editorno longer strands doc-version keys when the server slot is already gone; both POSIX frontends' LSP idle-drain no longer wedges the drain latch on its early-return path (a wedged slot kept appending torx_bufwith nothing draining it); Linux X11wx_pumpstopped leaking and silently swallowing queued events —poll_for_queued_eventdequeues, it doesn't peek — and Linux full-queueui_postdrops got destroy callbacks (chat hook requests, LSP dead-server notices). The pool regression test tightened fromgrowth < 1 MiBtogrowth == 0across 5000 edits — a tripwire, not slack.linux: pane dragging never worked — motion events reported the button as up.on_mousederivedleft_heldfroms.mouse_pressed, which only tracks a text drag, so a press on a pane's status bar (the drag grab handle, outside the text band) could never promote past the drag motion threshold. Motion events now carry real pointer-button state from the backend: X11 readsBUTTON_MASK_1offev.state(new xcb binding constants), Wayland uses theclient_lmb_downimplicit-grab flagptr_buttonalready maintains — wl_pointer carries no button state of its own. Same commit: X11 pointer coordinates are now divided to logical pixels on HiDPI (wx_logical— everything above the window layer works in logical px, so a HiDPI X11 session hit-tested every click at scale× its real position), and the X11 cursor cache is sized offlen(WinCursor)so adding a cursor enum value can't leave the cache short of the glyph table again.script: a~/.editor.luathat creates panes killed the process at startup —editor.pane.split_h()(orrun_command("sp"), a new tab, the sidebar) comes straight back into the config loader throughon_editor_initfor the new editor, whose config splits again; every level is native stack rather than Lua stack, so pcall never sees it and the process died on the stack guard page (splitattaches its leaf only afteron_editor_initreturns, so theMAX_PANEScap never tripped). Ag_loading_configguard makes the nested loads no-ops — the config is per-editor setup, so an editor created by the config just skips it, bounding nesting at one level whatever the chunk does. Pinned by a new reentrancy test; help.md now notes that startup layouts belong in.editor.prj(:project), not the Lua config.linux/macos/windows: a row straddling a pane's bottom edge painted into the pane below — the visible-row count deliberately overshoots so a partially-visible bottom row still paints, but only the row text was clipped; the row backgrounds and gutter marks paint before that clip, so the overshoot bled under the status line into the pane beneath. All three renderers now clip the whole row walk to the pane's text band (cairo clip / CG clip / D2DPushAxisAlignedClip) and break out of the walk at the band bottom.linux/macos/windows: overlay rects are measured through the text engine, not the byte grid — the byte model gives every codepoint one cell, but Pango/CoreText/DirectWrite paint—/→/…/CJK at their true (usually two-cell) advance, so each wide glyph in the prefix slid selection rects, search-match highlights, trailing-whitespace rects, diagnostic squiggles,:set listglyphs, bracket-match rects, extra cursors, the IME candidate rect, and the dbg-inline/fold-badge EOL annotations one cell left of the text they mark — drift accumulating across the row, worst in wrapped prose where wide glyphs live. macOS and Windows gained a per-row lazyRow_Xmeasurer (CTLine /IDWriteTextLayout::HitTestTextPosition, built with the same font attrs, tab stops, and ligature setting as the painted row so advances can't disagree; pure-ASCII rows skip it entirely; released per row, no cross-frame cache); Linux converted its three stragglers (diagnostics, dbg inline value, fold badge) to the existinglayout_x_of_byteand deletedpixel_x_of_byte_bytesoutright. Windows also moved the painted syntax-run origins themselves ontorow_x_at— runs used to overlap after wide glyphs — plus the status line and notification widths onto DirectWrite measurement. Windows is compile-verified only, per usual.debug: use-after-free crash when a Flutter/Dart VM session tears down — the Flutter/Dart teardown frees itsdbg.Clientwithout a priorsession_unregister(), leaving the paint path (dbg_inline_active_for) dereferencing the dangling client.destroynow unregisters itself when it is the registered active session, making every destroy path safe on all three frontends; idempotent for the LLDB path, which has already nil'd the client by then.tests/ci: thecore/editorsuite runs single-threaded in CI (-define:ODIN_TEST_THREADS=1) — its tests share process-global singletons (unnamed registerg_reg_text, marks table, float overlay) that are UI-thread-only in production, and the parallel runner could race delete+make on the register's heap allocation: heap corruption that detonated as a flaky Windows-only AV (test_vindent_interactive_set_and_typedying with "Signal caught: Unknown"; the identical tree passed minutes earlier). Full write-up incore/editor/REVIEW.md. Also: the script config-fixture test builds its path viaos.temp_directoryinstead of a literal/tmp, which doesn't exist for a native Windows exe.linux: cross-thread UI callbacks posted before window creation were silently dropped —main()installed theUiPosteronly afterw_open, but the argv file load (which spawns the git-diff base fetch) runs before it, so a reader thread finishing inside that window posted into a nil poster andui_postdiscarded the callback outright: the gutter stayed empty until the next refresh trigger and thegitchild (reaped inside the dropped callback) was left a zombie for the editor's lifetime. On small repos git reliably outraces window setup, so fast opens lost their gutter every time. The poster now installs windowless right afterep_init/tm_init— every window-dependent entry already guardsg_ui_win != nil— and re-installs with the real window afterw_open;chat_oneshot_initmoved out of the installer so it still runs exactly once. Base-fetch failures also log a WARN (exit code, oom/over-cap flags) instead of clearing the gutter with no trace; the success/spawn breadcrumbs sit at Debug level.lsp: server-registry exhaustion is surfaced instead of spawn-then-silent —server_registerreturned nil once allMAX_SERVERSslots were in use and all three frontends discarded the result, so the 9th language server's subprocess kept running with no slot:feed_bytesworked but the event drain (which walksg_servers) never saw it andsync_buffer'sserver_getcame back nil — no diagnostics, no completions, no error, plus an orphan child process.MAX_SERVERSis now 16 (there are exactly 8 built-in configs, so a singlelsp serveroverride could already exceed the old cap), and the limit surfaces instead of spawning: newserver_has_roomis checked by all three platforms'proc_ensurebefore the subprocess spawn, pushing a one-shot "lsp: server limit reached" notification + elog record when full (latch re-armed byserver_unregister). The guard has to sit pre-spawn:ensure_servers_for_active_editorsretries wheneverserver_getis nil, so a post-spawn teardown would loop spawn/kill every tick. The register call sites also nil-check now and tear the child down via each platform's reader-fail cleanup path (the Windows wrapper returns the slot so it can be checked),server_register's full-table path writes an elog record, and frontendMAX_LSP_PROCSis defined aslsp_pkg.MAX_SERVERSso the proc tables can't silently diverge from the registry again.
0.0.29
Added
editor: Sublime-styleCtrl+Pfile palette +Ctrl+Shift+Pcommand palette — both open a centered popup with the query input row (and caret) inside the panel, work in Normal and Insert mode, and are fully modal: the float owns the filter,e.modeis untouched while open, soEsc(or re-pressing the shortcut — it toggles) drops you back exactly where you were, Insert included.Ctrl+Pfuzzy-searches every project file through the same pipeline as:files(core/filesthreaded cache +core/fuzzyfzf-style scorer;ensure_syncon first use, no item cap — the:filespicker already pays the identical cost);Ctrl+Shift+Plists every space-menu command as "Description …:cmd", fuzzy-matched against description and command name. Accept reuses the CmdlinePicker payload convention wholesale: a payload ending in' '/'/'(templated<placeholder>rows like:e <path>,:s/<pat>/…) prefills the:cmdline in Command mode and_update_cmdline_floatimmediately opens the standard drill-in picker; anything else executes via_exec_command, restoring the caller's mode when the command was absorbed inline (status/:set/dirty-gate — same convention asspace_menu_accept), so running:wfrom Insert leaves you in Insert. Implementation: the dormantfloat.Kind.CommandPalette(declared 2026-05, never wired) is now live with a newAnchor.Center(fixedmin(600, win_w−40)width, x-centered, y ≈ 15% — each frontend'sdraw_floatgot the centered branch, a forced-on header row, and a 2 px caret after"› <filter>"); open/accept live in newcore/editor/palette.odin; a dedicated modal branch ineditor_handle_key(copied from.Custom, minus the Lua hooks) absorbs every key incl.PageUp/PageDownpaging; mouse rows accept via new publiceditor_palette_accept(own allocator setup) wired into all three frontends' float click dispatch ahead of the autocomplete fallback (which would have inserted the payload into the buffer). NewKey.CtrlP/Key.CtrlShiftP(34/35) plumbed through all three key translations — macOSKC_Pin the keyCode ctrl-switch, Windows'P'in both WM_KEYDOWN ctrl blocks, Linuxxkb.KEY_pin the_map_keysymctrl branch (this removes a latent Linux bug: Ctrl+P/Ctrl+Shift+P used to fold to plainChar 'p'/'P'and trigger PasteAfter/PasteBefore); commandsOpenFilePalette/OpenCommandPaletteare:map-able and persistable via new<C-p>/<C-S-p>tokens in_parse_key_token/_key_token_str/_parse_cmd_name. Bound in Normal + Insert (no conflict: Insert completion isCtrl+N/Ctrl+Spacehere, not vim'sCtrl+P). The space menu gained a previously-missing "Grep in project:grep <pat>" row (it feeds bothCtrl+Spaceand the palette — "gre" used to top-rank "Toggle breakpoint"). The go-to-line:<n>row is skipped (empty prefill prefix); it stays reachable via:and the space menu. Palette filter is ASCII-only (existing float[256]bytelimitation). help.md: new Command Palette section + key list entries.
editor: engine-owned indentation (:set vindent) — 4coder-style "virtual whitespace" on real bytes. Opt-in per config (set vindent/set vindent!persisted /set novindent), gated to brace languages (C, C++, Odin, Dart, Swift, Rust — never Python/Yaml/Md/Lua/Ada or virtual buffers): after every mutation the editor recomputes each changed line's leading whitespace asunit × max(0, entry_depth − leading_closers)and rewrites it in place, so indentation is never typed or fixed by hand and the engine always wins over manual indent edits. Buffer == disk — unlike true 4coder stripping, LSP, gitdiff, grep, plugins, and registers see ordinary text. Bracket depth comes from the lexer (newcore/editor/indent_engine.odin+ the block-comment cache generalized into a per-lineLine_State{syn, depth}cache insyntax_cache.odin), so brackets inside strings/comments/raw strings/whole-line#macro spans never count, and lines starting inside a block comment or raw string are never touched. The fixup hookseditor_note_mutationbefore the sem-token/fold carries with a re-read op-seq, so its rope ops ride the same journal replay and the same singlerope_versionbump — zero extradidChangetraffic; changed lines come from the edit-journal chain walk (undo/redo, journal overflow, and rope swaps skip the fixup entirely — no full-reindent fallback that would fight undo, plus a deterministicvindent_skip_onceset by_undo_restoreagainst pool address-reuse roulette), and an unbalanced-brace edit propagates downward only until the first conforming anchor line (entry depth is a prefix sum), capped at 4096 rows. Insert-mode ergonomics: typing}dedents via the formula (_try_dedentgated off), Backspace with only whitespace left of the caret joins to the previous line through the indent in one op (otherwise it'd be a dirty-marking no-op the fixup reverts same-keystroke; multicursor path reuses_done_shift_join'sws_n), Esc strips whitespace-only cursor lines while mid-insert lines keep the computed indent under the caret, Tab inside the indent parks the caret at the indent end, and>/</ visualH/Lrefuse with a status instead of pushing a junk undo entry. Normal-mode cursors never rest inside the indent — newCursor.snap_indentflag applied in_clamp_col(covers0, j/k, mouse clicks, DAP/grep col-0 jumps;0behaves like^). Opening or enabling on a non-conforming file never rewrites it: an O(n) conformance scan posts "N line(s) differ — :reindent to normalize", and the new:reindent(works with vindent off too, undoable, idempotent) is the only whole-file rewrite — theset vindenthandler also runs from~/.editorconfig replay, where auto-reindent would dirty every opened file. Indent unit (tab vs N spaces) comes from_detect_indent, cached per buffer and re-detected on load. help.md + cmdline completion vocab updated.editor/marks: marks now track edits, like vim's.ma…`aused to store a frozen (path, row, col) — inserting or deleting lines above a mark left it pointing at the wrong line. Marks are now the third consumer of the rope edit journal (after semantic tokens and folds): newmarks.apply_edittransforms each same-file mark's (row, col) per journaled op, wired via_marks_note_mutationineditor_note_mutationwith the sameold_root-chain walk (foreign buffers can't chain — that's the per-buffer gate; per-editor rope pools make aliasing impossible). Deliberate boundary semantics: a mark exactly at an insert point shifts with the inserted text (so`akeeps tracking the character it was set on and delete-then-retype round-trips), and a mark inside a deleted range clamps to the deletion start instead of being dropped (vim invalidates; a jumpable mark is strictly more useful). Degradation: a broken chain (undo rope swap, journal overflow) leaves marks frozen — exactly the old behaviour, and vim makes no stronger promise across undo. File loads never shift marks (editor_set_contentre-stampslast_rope_op_seq); persistence rides the existing structural-autosave triggers. Path gating is the same raw compareJumpMarkExactuses, so whatever can be jumped to is exactly what shifts. help.md updated. Breakpoints share the frozen-(path,line) gap and can reuse this mechanism later.debug/editor: breakpoints now track edits, like marks.Breakpoint_Record.linewas frozen at toggle time — inserting/deleting lines above a breakpoint desynced the gutter dot, the store, and the adapter from the shifted source. Breakpoints are the fourth consumer of the rope edit journal: the marks walk ineditor_note_mutationis now_positions_note_mutationand drives adbg_shift_hookregistered bycore/host(editor can't import debug — same cycle-breaking proc-pointer pattern asproject_hook_*).debug.shift_breakpointsmodels each breakpoint as its line head, the point (line, col 0): Enter mid-line keeps the dot on the line, Enter at col 0 moves it down, a delete ending at col 0 merges it upward, and a breakpoint inside a deleted range clamps to the range start — the transform is monotone, so the sorted store needs only adjacent dedup (first record wins; condition/verified/oneshot survive shifts). When any line actually moved and a session is live, one coalesced re-send per mutated file per keystroke goes through the exact backend branch toggling uses (DAPsetBreakpoints; Darton_set_bps→_resync_file, which diffs by line so shifted breakpoints re-bind automatically); enqueue-only — the bytes reach the wire at the next pump, before the next continue/step/eval. Degradation: broken journal chain (undo rope swap, overflow) leaves breakpoints frozen — the old behaviour. Known limitation: raw-path compare (same as marks/JumpMarkExact) — symlinked/relative opens stay frozen. Follow-ups noted: project-switch still merges breakpoint sets (load deliberately doesn't clear), and an unconditional per-keystroke pump in the frontends would tighten wire latency. help.md updated; newbreakpoints_clear_allfor test hygiene.
Fixed
linux/macos: subprocess stdin writes moved off the UI thread — the same blocking-write flaw just fixed on Windows existed on both POSIX frontends: dbg/lsp/flutter pumped core outbound queues with blockingposix.writeon the UI thread (EINTR-retry only, no O_NONBLOCK anywhere), so a hung or backpressured child froze the editor; Linuxlsp_proc_stop_oneadditionally had a bare no-retry write. New per-platformwriter_thread.odin(duplicated like proc_util/chat, per convention) ports the WindowsStdinWriterontosync.Mutex/sync.Cond+ malloc'd-chunk FIFO with the POSIX mechanics taken from chat's proven one-shot writer: the writer thread owns the atomic stdin fd outright (exchange-then-close; the field is gone from all six session structs) and teardown unblocks a stuckwrite()with a SIGUSR1 EINTR kick (no-SA_RESTART no-op handler) — closing the fd from another thread can't unblock it, and child death alone can't either when a grandchild (flutter run, lldb-dap both spawn them) inherited the pipe's read end. That grandchild case is also why join is a done-flag +cond_wait_with_timeout(2 s)with the Windows leak-if-hung convention instead of the platforms' old unboundedthread.join(Odin has no timed join;thread.destroyis never called on a live thread). Overflow past 8 MiB is sticky poison surfaced once viaui_post(Linux eventfd, destroy-hook frees) /ui_post_main(macOS dispatch, callback frees) → notification + subsystem status. Stop paths gained boundedwriter_flush(500 ms)so LSP didClose and the flutter daemon's app.stop frame still reach the child before SIGTERM — the old synchronous writes delivered those implicitly. Reader joins get the same SIGUSR1 kick (converts a reader hung on a grandchild-held pipe into prompt EOF); stdout now closes after the reader join. This closes the "helper ports 1:1" follow-up promised in the Windows entry.windows: subprocess stdin writes moved off the UI thread — dbg (lldb-dap), lsp, and flutter pumped their core outbound queues with synchronousWriteFileon the UI thread, so a hung or backpressured child (full 64 KiB pipe, non-reading server) froze the whole editor. New sharedwindows/writer_thread.odin(StdinWriter: CRITICAL_SECTION + CONDITION_VARIABLE + malloc'd-chunk FIFO): the UI thread still callspop_outbound(core clients are single-threaded by contract) but only enqueues copies; the writer thread owns WriteFile and the stdin handle outright (thein_writefield is gone from all three session structs, so no stale close site can exist). Teardown ordering isstop → TerminateProcess → join— the parent closed itsin_readat spawn, so child death breaks the pipe and unblocks a stuck write, and stop-before-terminate keeps deliberate shutdowns from surfacing as errors. Queue overflow past 8 MiB is sticky poison (dropping one chunk mid-JSON-RPC corrupts the stream anyway): drop + one elog WARN + oneWM_APP_WRITER_ERROR→ notification + subsystem status; recovery is restarting the subsystem.lsp_proc_stop_one's inline shutdown drain became enqueue + boundedwriter_flush(500 ms)— strictly better than the old unbounded UI-thread write into a full pipe. Chat's one-shot prompt writer deliberately stays (closing stdin IS its end-of-input signal) but now elogs on write failure, and its writer-create-failure path no longer leaks the session slot (joins the already-EOF'd reader first — the REVIEW's suggested barefree_sessionwould have been a UAF). The same blocking-write flaw exists on macOS/Linux (posix.write, no O_NONBLOCK) — the helper ports 1:1 onto pthread mutex/cond when that follow-up lands.windows: key dispatch never callededitor_note_mutation— the shim replicated the version bump with the known-bad pointer-only rope compare, so ~43% of single-char edits (pool address reuse) sent nodidChangeand the sem-token/fold journal carries never ran on Windows at all. Now routed througheditor_note_mutationlike Linux/macOS (also a hard prerequisite for vindent on Windows).linux/macos/windows: accepting a completion by clicking the float bumpedrope_versionmanually — swap marking and the journal carries deferred to the next key event, and the vindent fixup wouldn't have run until then either. All three float-accept paths now capture the pre-edit root and calleditor_note_mutation.buffer:EDIT_JOURNAL_CAPraised 128 → 512 (~32 KB static) — a multicursor sweep, a:%swith >64 matches, or a vindent fixup rewriting one line per row overflowed the ring and broke the sem-token/fold carries (tokens blink out until the next LSP response, folds clear). The overflow degrade path is unchanged, just ~4× further away.
0.0.28
Added
plugin/sdk: native plugin system — users can extend the editor with their own shared libraries (.so/.dylib/.dll) in any language that exports C symbols, alongside the existing Lua layer. A plugin exports six entry points (editor_plugin_abi_version+editor_plugin_initrequired;name/on_editor_init/on_editor_destroy/shutdownoptional) and receives one pointer to a versioned struct of 68proc "c"function pointers (Host_API) mirroring the Luaeditor.*surface: status/log/run_command/handle_key, register_command + map_builtin/map_cmd, buffer read/insert/delete, cursor, mode, file, ghost text +on_text_changedlisteners, unnamed register, theme, diagnostics, tags, font, the Custom float (with accept/cancel callbacks), and panes/tabs. The editor binary still exports nothing — the vtable-at-init design keeps the "no C-ABI/FFI layer" invariant and needs zero linker changes on any platform; each wrapper incore/plugin/vtable.odinis the native twin of its_lua_*counterpart incore/scriptwith the same per-editor allocator discipline. Loading (all three paths feed one loader, deduped by canonical path): auto-scan of~/.editor.plugins/at startup (sorted, before the pane tree exists so plugins see editor #1), aplugin <path>directive in~/.editor(re-runs per pane are silent no-ops), and:plugin <path>at runtime — which fanson_editor_initout to every already-open pane;:pluginslists what's loaded. A plugin loads once per process and is never unloaded (dlclose only on validation/init failure, so registered callbacks can't dangle;shutdownfires best-effort at exit); per-editor attach/detach rides the samecore/hostlifecycle hooks as Lua, and plugin-registered commands dispatch through the existinguser_commandspath — searched before the Lua fallback — viaUserCommand's newuser: rawptrcontext field (the old signature had zero callers). ABI contract, stated in the header and pinned by tests: callbacks fire on the UI thread only; every returned string is host-malloc'd and freed viaapi->str_free(never the plugin's own CRT — the Windows mismatch trap); all indices 0-based (Lua stays 1-based);dynlib.load_libraryuses RTLD_LOCAL so an Odin-built plugin's runtime can't collide with the host's. SDK:sdk/editor_plugin.h(canonical C header,_Static_assertlayout pin) +sdk/odin/editor_plugin.odin(dependency-free Odin mirror, imported by both the host and Odin plugins), hello-world examples in C and Odin undersdk/examples/(make plugin-examples;make test-plugindlopens the Odin one through the real loader). help.md's stale "C Scripting API" section (documenting the removed FFI) is replaced by a Native Plugins section incl. the macOS Gatekeeper quarantine note;plugin/pluginsadded to cmdline tab completion.
0.0.27
Added
editor: normal-mode multi-cursor editing —x,r,s,~,D,dd,J,p/Pnow act at every cursor instead of only the primary (previously the whole normal-mode edit family silently ignoredextra_cursors; only movement and the five Insert-mode edits swept). Each command got the established descending-byte-offset sweep with done-set position repair, backed by three new shared helpers inmotion.odin:_dedup_extra_by_row(line-wise ops act once per row — the primary wins its row, the leftmost extra survives elsewhere, so two same-line cursors can't double-dd),_done_shift_rows(whole-row deltas fromdd/ linewise paste), and_done_shift_insert_text(multi-line charwise paste splitting a row under already-processed cursors);Jreuses_done_shift_join, now taught the stripped-leading-whitespace offset so a done cursor on the absorbed line lands on its own character. Semantics: one keypress = one undo step (a lazy single_push_undobefore the sweep's first real mutation; undo restores the whole edit and collapses to one cursor, as_undo_restorealways did), deletes put the primary cursor's text in the unnamed register (extras' text is discarded; linewise fordd, charwise otherwise), ands+ typed text +Escstays a single undo group via the existingin_insert_grouplatch. The per-cursor bodies are factored into_delete_line_at/_delete_to_eol_at/_join_lines_at/_paste_after_at/_paste_before_at/_char_width_at/_toggle_case_at/_replace_char_atinedit_ops.odin, with the old single-cursor procs as thin wrappers — thelen(extra_cursors) == 0fast paths are byte-for-byte the old behaviour.editor: cursors can now share a line — two ways to create them (storage, offset-keyed dedup, and all three renderers always supported same-line cursors; only row-basedCtrl+Shift+↑/↓creation existed).Ctrl+N(AddCursorWordNext,:map-able) adds a cursor at the next whole-word occurrence of the word under the primary cursor — wraps around viarope_find_next, skips occurrences already carrying a cursor, refuses at the 32-cursor cap, and the newest match becomes the primary (vim-visual-multi style), so repeated presses collect matches one by one. Free in Normal mode; Insert-modeCtrl+Ncompletion is untouched.Alt+Clickon all three frontends adds an extra cursor at the clicked cell, Alt+Clicking an existing extra toggles it off, and a plain click now collapses extras (matchingEsc); the branch sits after the float/tab/separator/fold-gutter hit-tests and returns before drag arming, so drag-select, double-click word-select, and triple-click line-select are unaffected (Windows also interceptsWM_LBUTTONDBLCLKso fast Alt-toggle clicks never word-select). Each frontend's pixel→(row, byte) click resolution was factored out of its set-cursor path (_click_resolve/click_row_byte) and reused verbatim, so Alt+Click goes through the same Pango / CoreText / DirectWrite hit-test as a normal click — correct after em-dashes, arrows, CJK, and inside wrapped rows. Core side: new publiceditor_add_cursor_at(e, row, col) -> bool(clamps, snaps to a UTF-8 lead byte, no-ops on the primary, toggles on an occupied offset, enforcesMAX_EXTRA_CURSORS; deliberately avoidscursor_goto's scroll/fold-reveal side effects). Only the Alt bit is tested, soCtrl+Alt+Clickworks where the WM grabs plain Alt+Click for window dragging (documented in:helpalong with all of the above).
Fixed
editor: entering Insert viaa/A/Imoved only the primary cursor — extras entered insert at their unshifted positions, soa+ typing with multiple cursors put the text before the character under every extra cursor (AandIcompounded worse, stranding extras at their old columns). All three now apply the same column adjustment to every extra cursor (a's not-past-EOL/newline check per cursor,Ato each cursor's own line end,Ivia_move_first_non_blankper cursor).linux: Wayland pointer events always reportedmods = 0—ptr_buttonbuilt itsWinMouseEventwithout modifier state (wl_pointer carries none), so every modifier-gated mouse feature was dead on the Wayland backend while working on X11. Newkm_current_modsinkeymap.odinreads the effective mask off the seat keyboard's xkb state (fed bykm_update_mask; valid while we hold keyboard focus, which a click implies) and fillsmodson the press/release paths.
13 new regression tests in core/editor/multicursor_regression_test.odin (same-line x + one-step undo, UTF-8 r width-delta repair, dd same-row dedup + row shift, D, adjacent-row J, charwise / multi-line charwise / linewise paste, s+type+Esc single undo step, a extras adjust, Ctrl+N whole-word/wrap/occupied, editor_add_cursor_at clamp/toggle/cap). Verified: odin test core/editor (147) + core/buffer (75); make mac; odin check windows -target:windows_amd64; linux typechecked via the wayland-stub recipe (the two-line Wayland mods change still wants a real make linux); macOS runtime-verified end-to-end via the snapshot harness — Ctrl+N×2 + x edited all three occurrences in one press and an Alt+Click through the real mouse_handle_press path added a fourth caret mid-line, all four rendered.
0.0.26
Fixed
theme/config::theme!silently wiped persisted:color!overrides on the next startup — the config replays top-to-bottom, so acolorline written before a laterthemeline dead-replayed and then vanished whenset_by_namereplaced the whole palette.:theme!now persists via the newconfig.persist_line_dropping, which drops every persistedcolor <role>line and appends the theme line in one locked atomic rewrite;colorlines written after the theme line keep working. The rewrite core is factored into a pure, testedrewrite_content(newodin test core/configtarget), which also strips a UTF-8 BOM from externally-edited configs (read_apply_lines/read_wingeometrytoo — a BOM'd first directive used to fail key-matching and ship as an unknown command).project::project loadover a live session layered the saved layout onto the open tree — leftover tabs survived, tab 0's splits nested under the focused pane, and virtual buffers got stamped._replaynow collapses to a single leaf first via the newpanetree.collapse_to_single_leaf()(the survivor is the focused editor: the command executes inside its key dispatch, so destroying it would dangle the live context allocators; everything else tears down through the normalon_editor_destroypaths). Also added a recursion depth guard to_replay_node— a corrupt.editor.prjnestingsplitlines thousands deep was a stack-overflow crash; it now bails pastMAX_DEPTH(256) and abandons the tab. Both pinned by the newodin test core/projecttarget (dirty-session replace + 100k-split spec).elog: the contextless crash path readg_handle_validtheng_handlewith no memory ordering — on arm64 a crash landing mid-rotation could observe (valid=true, handle=stale/0) and write the FATAL record to a closed or recycled fd, losing exactly the record that matters. The pair is collapsed into one atomic word (g_handle, sentinelHANDLE_NONE = ~0):.Releasepublish after open,.Seq_Cstunpublish before close, single.Acquireload into a local on the crash path — the torn state is unrepresentable.results: search/diagnostic rows for unnamed buffers were emitted as[No Name]:N:and parsed as a real path — Return tried to open a file literally named[No Name]. Unnamed-buffer rows now carry the results pane's two-space non-clickable indent (matches stay listed and counted;:helpnotes they aren't jumpable). Pinned incore/resultsand a newcore/editorrow-parse test.script: every Lua chunk execution leaked its return values — all three pcall sites usedLUA_MULTRETand never popped on success, so~/.editor.lualoads and:lua return …climbed the per-state stack towardMAXSTACK(eventual "stack overflow" from pcall). Chunks now run withnresults=0(their results were never consumed).tags:Ctrl+]usedstrings.containson the^-stripped ctags pattern, jumping to the first line that merely mentioned the definition (comment, forward declaration). Pattern anchors are now honoured (^…$exact,^…prefix,…$suffix), and?pat?reverse addresses — previously silently resolved to line 0 — are accepted via the same forward scan;_parse_addressreports unresolved addresses instead of conflating them with line 0.lsp: a malformed entry in a completion/signature-help response left a zero-valued slot in the pre-sized array — a blank picker row whose accept inserted nothing. Both handlers now use a write cursor and shrink to the written prefix, mirroring the earlier_handle_publish_diagnosticsfix.syntax: results-pane header detection had no boundary check — a row forMarks_test.odin(or any path startingBreakpoints/Diagnostics) was painted as a header; the checks now match the exact builder output including the separator, the dead"Breaks"check is gone, andGrep:headers (previously missed entirely) get the header tint.detect_langwas case-sensitive on extensions —main.C/README.MDgot no highlighting; the extension is lowercased before the switch.flutter:set_devices_jsonwiped the device list before parsing, so a banner-only/malformedflutter devices --machineresponse emptied a previously-good picker — it now stages and swaps only on parse success. The:evalpath registered avariables_refper evaluation intovm_refs, which is only reclaimed on pause — evaluating in a running session grew it unboundedly; the eval path now skips the registration (_make_varwant_ref).debug: toggling the last breakpoint off in a file left the empty per-file list and its heap-cloned path key in the breakpoint map forever; the emptied entry is now unmapped and freed (the adapter still receives the clearingsetBreakpoints).windows: batch of platform fixes — the dbg reader thread now exits whenPostMessageWfails instead of busy-spinning a core against lldb-dap's stdout; git-diff gutter stripes read thegitdiff_*theme slots instead of hardcoded RGBs; flutter_vm teardown joins the readerINFINITEafter the graceful WebSocket close (the 2 s timed wait + unconditional free was a use-after-free window); the tab-bar[No Name]label no longer strdup's unchecked (OOM nil-deref); the chat child env block is double-NUL terminated even when parent env enumeration fails;load_file_into_editorloopsReadFileto completion (a short read silently truncated the buffer) and surfaces the >1 GiB rejection as a status instead of a silent no-op; LSP quit no longer stallsSleep(30)per server (bounded wait on the process handle, ~0 ms for prompt exits).windows: git-diff refresh rangit showsynchronously on the UI thread with an uncapped realloc buffer — a wedged git (cold pack, AV scan, smudge filter) or a huge tracked blob froze the editor, and opening any file on a UNC share (\\server\share\…) hung it forever via a no-progress loop infind_repo_root. The walk now terminates (plus a share-root floor so\\server\.gitis never probed — SMB name resolution can block for seconds), and the refresh is fully asynchronous on the Linux model: 32-slot job table, reader thread +WM_APP_GITDIFF_DONE, 16 MiB output cap, supersede-on-refresh coalescing, pane-alive + path-identity stale guards (closes the editor-pointer-reuse ABA), andgit_diff_shutdown()in main teardown. Behavioral delta: stripes land one message-pump after refresh instead of synchronously before the next paint.
0.0.25
Fixed
editor: bug sweep #3, multi-cursor core — two defects in the descending-offset multi-cursor insert paths, both pinned by regression tests (core/editor/multicursor_regression_test.odin). No cursor cap:Ctrl+Shift+↓/↑appended extra cursors without limit while every multi-cursor insert path sized its bookkeeping table as[33]bool— the 33rd extra cursor indexed past it: bounds-check panic in debug builds, out-of-bounds stack write undermake release(-no-bounds-check). Extras are now hard-capped at 32 (MAX_EXTRA_CURSORS, the tables sized from it; further presses are a no-op like hitting a buffer edge;:helpdocuments the cap). Stale positions after structural edits: cursors are processed highest-byte-offset-first, which protects unprocessed cursors — but a later (lower-offset) newline insert, backspace line-join, or forward-delete join shifted the line structure under every already-processed cursor, whose stored(row, col)was never repaired. Symptom: multi-cursorEnterthen typing put the higher cursor's text on the wrong (often empty) line; adjacent col-0 backspaces compounded into wrong columns too. Each mutation in the pass now repairs the done set via three shared helpers (_done_shift_split/_done_shift_join/_done_shift_inlineinmotion.odin) covering newline splits (with re-indent), line joins (row collapse + column shift), and same-row byte inserts/deletes — applied across.InsertChar,.InsertNewline,.InsertBackspace,.InsertDelete, and.InsertTab.editor: accepting an autocomplete float (Tab/Returnon a completion) mutated the rope — prefix delete + payload insert,rope_versionbumped,read_onlyhonoured — but never sete.dirty. On an otherwise-clean buffer the status bar showed no[+],:q/:bdskipped the unsaved-changes guard, and no crash-recovery swap was ever flushed (editor_swap_mark_dirtygates one.dirtysince 0.0.24): the accepted completion was silently lost on quit. Both mutation branches now sete.dirtyalongside the version bump, matching every other mutation path (the ghost-accept paths already did).editor: a charwise visual delete that empties the buffer (v+G+dover the whole file) stranded the cursor at its old row —_cursor_goto_offsetearly-returned on an empty rope without touching the cursor, so the status bar read e.g.5:1in a 1-line empty buffer, the cursor painted rows below the only line, andxthere no-op'd; withcinstead ofdthe stale row compounded upward on every newline. The empty-rope path now snaps the cursor to(0, 0)(the line-mode branch already clamped). Regression test inmulticursor_regression_test.odin.editor::%s/<pat>/<rep>/without thegflag replaced every occurrence on each line —globalwas computed ashas 'g' || all_lines, contradicting vim semantics and the comment two lines below it (gwidens within a line, not across; the range only widens across lines). Now first-match-per-line withoutg, exactly like:son one line;:helpdocuments both:%sforms. Regression tests pin%swith and withoutgon multi-match lines (replace_cmd_test.odin).windows: Ctrl+Backspace in Insert mode inserted an invisible U+007F DEL byte into the buffer —TranslateMessagesynthesizes aWM_CHARof0x7Ffor Ctrl+Backspace, the< 0x20control filter let it through, and core's.InsertCharaccepted anything>= 0x20; the WM_KEYDOWN leg had already backspaced once, so the visible effect was "delete one char, then corrupt the file with a control byte" persisted by:w. The WM_CHAR filter now rejects0x7F, and.InsertCharrejects it in core too (defence for all frontends — Linux/macOS map keys before this point and couldn't hit it).windows: fold-marker clicks toggled the wrong line in the lower half of a tall window — the fold-gutter hit-test passedc.int(s.char_height)toeditor_pixel_y_to_rowsub, truncating DirectWrite's fractional line height (e.g. 16.406 → 16) whiledraw_paneplaces rows (and markers) atf32(row) * s.char_height; from roughly row 40 down every click resolved one row below the marker actually clicked. The click y is now divided in float first (row_y = ly / char_height, unit char height into the rowsub walk), the same shapeset_cursor_from_clickalready used — which is why text clicks were immune. Linux (integer cell height) and macOS (roundedg_char_h) don't share the drift.windows:refresh_window_titleleaked the display-name cstring (editor_get_display_namereturns amalloc'd basename) on every WM_PAINT — keystrokes, scrolls, blinks; hours-long sessions leaked steadily, fastest while holding a key. The name is now freed on both the changed-title and unchanged-title paths.macos: every mouse press and drag-motion event permanently leaked a copy of the clicked line —visual_col_for_clicksetcontext.temp_allocatorto the rope pool (ep.perm) instead of the per-event scratch arena, sorope_get_line's temp line buffer fell into the pool's arena fallback, which is only released on:e. Drag-selecting across a long line at motion-event rate pinned hundreds of KB per second of dead line copies. Now mirrors the Linux_click_set_cursorpattern: scratch arena as temp allocator +arena_free_allon exit.macos/windows: the floating overlay (autocomplete / hover / signature help) rendered two character cells left of its anchor column during debug sessions — both platforms' float draw paths computed the gutter without the 2-cell breakpoint column that shifts the pane's text origin right whenever a session is live, while their own IME/hit-test code already included it (view_state.odin/hit_test_text'scompute_gutter_w, whose comment states the invariant). Both float anchors now addpane_bp_col_w, matching Linux'scompute_gutter_w-based anchor.linux: releasing a text-selection drag over a Wayland CSD title-bar button activated the button — including close: press in the text area, drag the selection up past the title bar, release over the ✕ and the window closed from a selection drag (ptr_buttonclassified the release purely by pointer position; the compositor's implicit grab keeps routing events to us during the drag). Over min/max the same path swallowed the RELEASE entirely, somouse_pressedstayed latched and every subsequent bare mouse move kept extending the selection until the next click. Presses are now tracked to their origin: a left press delivered to the client area owns the button until release (RELEASE always forwarded to the editor, CSD zones ignored, hover suppressed during the drag), and a title-button click only fires when the press armed that same button — press-and-drag-off still cancels.linux: X11 clipboard fixes, both sides of the protocol. Serving: answering a UTF8_STRING request with oneChangePropertycarrying the whole owned buffer dies withXCB_CONN_CLOSED_REQ_LEN_EXCEEDonce the selection exceeds the server's maximum request length (~256 KiB classic / ~16 MiB with BIG-REQUESTS) — libxcb shuts the connection down,wx_drain_eventssees the dead connection, and the editor exits, discarding unsaved buffers; yanking a large buffer triggered it the moment any clipboard manager auto-fetched. The responder now writes 240 KiB chunks (PROP_MODE_REPLACEthenAPPEND), each safely under the classic limit. (INCR receive already existed; serving stays single-property, just chunked.) Requesting: a second Ctrl+V while a paste was pending silently overwrotepending_cb/pending_user, orphaning the previous heap-allocated shim+ctx pair (leak per repeat paste against a slow owner) — the stale pending is now failed over viaincr_finish(sel, false)so it frees itself; and the reply callback dereferenced the captured^Editorwith no liveness check, a use-after-free when the target pane was closed while a hung selection owner took seconds to reply —on_clipboard_pastenow verifies the editor is still in the pane tree before pasting.linux: the AI ghost-suggestion round trip (inline_suggestions = ai, non-streamingclaude --print) used a raw^Editoracross an async gap with no liveness check and no cancel-on-destroy — close the split while the request was in flight (it takes seconds) and the delivery wrote status + ghost text into the freed editor, allocating through its freed rope-pool arenas; the 250 ms debounce path could do the same for an editor closed inside the window. Both the debounce fire and the delivery callback now verify the editor is still in the pane tree (same pattern asshell_pane_still_alive/ git_diff) and drop the response otherwise.linux::! cmdreaped the child with a singleWNOHANGattempt when stdout hit EOF, then freed the session regardless — a command that closes its stdout/stderr before exiting (daemonizing wrappers,exec >&-), or a pane-close SIGTERM racing the EOF, left a permanent zombie and showed a bogusexit -1; with a:run debugbuild continuation the phantom-1also wrongly suppressed the debugger launch after a successful build. EOF now joins the reader once and, if the child isn't waitable yet, pollswaitpidon a 200 ms timer — the final status line, build→debug chain, and session teardown all run only once the real exit code is in hand.flutter/debug: spawned Dart isolates were paused forever under:run debug—--pause-isolates-on-startpauses every isolate including ones created later byIsolate.spawn/Isolate.run, but the Debug-stream handler never looked at the event's isolate id: the one-shotstart_resume_sentguard (main-isolate bookkeeping) swallowed the secondaryPauseStart, and even without it the resume RPC always targeted the main isolate. The program hung at the spawn point with no indication why.PauseStart/PauseExit/PausePostRequestevents from a non-main isolate now resume that isolate by its own id (_send_resume_isolate); main-isolate flush-then-resume bookkeeping is unchanged.debug/flutter: run-to-cursor breakpoints were never removed in Dart/Flutter sessions — the oneshot flag set byrun_to_lineis honoured only by the DAP response handlers (_on_stopped/_handle_stack_trace_response), which never execute on the.Dartbackend, so the "temporary" breakpoint became permanent: every later continue stopped there again and every resync re-sent it to the VM. The Dart pause path (set_paused, the VM-service entry) now runs the same oneshot-by-location cleanup, and_remove_oneshot_by_locationroutes the resulting breakpoint flush through the.Darton_set_bpshook (which diffs the store against the VM cache and issuesremoveBreakpoint) instead of the DAP-onlysetBreakpointswire call.flutter: toggling a breakpoint off while itsaddBreakpointWithScriptUriwas still in flight left an invisible active breakpoint in the VM — on a blank/comment line the client retries up to 8 sequential line+1 probes (easily >1 s against a device),_resync_filecouldn't remove what wasn't cached yet, and the late success response installed and cached it anyway; the app kept stopping on a line with no gutter dot. The add-result handler now re-checks the dbg store for the original and migrated line and, if the user removed the breakpoint meanwhile, immediately sendsremoveBreakpointinstead of caching it.chat: plain-text agents (codex/gemini) corrupted the transcript around empty output and cancels. An agent exiting with no stdout (bad flag, nonzero exit) produced### User, then[no response — agent exited N], then a second### User— the parser's synthesizedTurn_Endheading andsession_finish's no-response banner both fired, rendering the error banner as user content and feeding the duplicate heading into the next turn's prompt context. AndEsc-cancelling mid-stream appended[cancelled]below the synthesized### Userheading — also rendered as user text. The syntheticTurn_Endis now gated on the parser having emitted any output at all, and the cancel path skipsparser_finishentirely (matching the stream-json agents, whose result envelope drives the heading).
All of the above: found by a four-way adversarial code sweep with every fix verified against the reported failure path before changing code; built + full test suite on linux (133 core/editor incl. 6 new regressions, 75 core/buffer, 22 core/flutter, 11 core/lsp, 46 core/script), typechecked windows + macos (full frontends).
0.0.24
Added
editor/buffer/linux/macos/windows: code folding — vim-styleza(toggle) /zc(close) /zo(open) /zR(open all) /zM(close all) on the existingzchord fold multi-line{}/[]/()blocks (same string/char-literal skip rules as%) and block comments (/* */, Lua--[[ ]], found via the block-comment syntax cache's per-line state transitions); visual-modezffolds the selected lines manually. A closed fold keeps its head line visible with a dim⋯ N linesbadge after the text; with line numbers on, the fold marker gets a dedicated gutter column (gutter is now digits + 3 cells: left pad, fold cell, right pad) showing▸(closed head) /▾(foldable line), and clicking the marker toggles the fold — draw and mouse hit-test were widened in lockstep on all three frontends, so the gutter draw/hit-test invariant holds, and a fallback-font marker glyph wider than one cell overflows into the padding instead of onto the text. Architecture: closed folds are plain line ranges incore/buffer/fold.odin, shared with the cursor through a newCursor.foldspointer, so every scroll/motion path (j/k, half/full paging,H/M/L, wheel scroll, mouse hit-testing, wrap math) skips hidden lines with zero signature changes, andcursor_goto— the chokepoint all jumps already funnel through — auto-opens a fold that searchn/N,gd,:N, marks, or pickers land inside; the cursor and viewport top can never rest on a hidden line. Edits shift/grow folds by replaying the rope edit journal (the semantic-token carry mechanism), with whole-line-edit normalization soO/ddabove a fold shift it instead of dropping it; an edit touching the head line silently opens that fold, undo/:eclear all folds. All six commands are:map-able (FoldToggle/FoldOpen/FoldClose/FoldOpenAll/FoldCloseAll/FoldCreate). Renderer-side, every frontendrow - scroll_rowpoint lookup (cursor, ghost, extra cursors, bracket highlight, float anchor, diagnostics, IME rect) was replaced by a shared fold+wrap-awareeditor_row_to_view, and windows' drifted local copies of the core viewport procs (editor_pixel_y_to_rowsub/editor_set_cursor_pixel/editor_scroll_lines/editor_scroll_hpx) now delegate to core so the fold walks exist exactly once. Known v1 deviations (documented in:help): relative line numbers count logical lines across folds;ddon a head deletes only the head line. ~20 new tests (core/buffer/fold_test.odin,core/editor/fold_test.odin: range ops, edit-carry matrix, motion skipping, discovery incl. literals, command dispatch, gutter click); runtime-verified onlinuxvia scripted key dispatch + screenshots (fold/unfold,zM/zR, search-jump auto-open, badge + marker rendering, wrap); typecheckedmacos+windows(full frontends).project: closed folds persist in.editor.prj— newfold <path> <head> <tail> <kind>lines (path relative to the project root, likebp/mark) are emitted per file from the pane walk on save and restored after the session replay. Folds are applied after the leaves' cursor restores (which go throughcursor_gotoand would auto-open a covering fold); ranges are clamped against the file's current line count so a file edited outside the session degrades gracefully, and a restored cursor that would land hidden snaps to the fold head. Runtime-verified onlinuxwith a two-process round-trip: fold →:project save→ fresh launch from the project directory restores the closed fold (badge + hidden lines) on arrival.
Fixed
editor/buffer: bug sweep #2, editing core — four UTF-8/motion defects, each pinned by a regression test (core/editor/bugsweep_regression_test.odin). Charwisepwith the cursor on a multibyte char advanced the insert point by one byte and spliced the register mid-codepoint — invalid UTF-8 in the rope, persisted to disk by:w; the paste offset now steps by the full codepoint stride (same lead-byte switch ascursor_move_right).T{char}with a multibyte target landed one byte into the target's codepoint, and the continuation-byte snap-back put the cursor on the char instead of after it; it now lands atpos + codepoint_len.t/Treturned unconditionally after a lead-byte-only partial match, so a different codepoint sharing the target's UTF-8 lead byte earlier in the scan (àbeforeé— both0xC3) silently killed the motion; the scan now continues past partial matches likef/Falways did. And visual-lineJwith the selection on the last real line of a newline-terminated buffer double-counted the phantom empty last line — the region rebuild emitted it as a joined line and re-appended the trailing\n, materializing a new blank line on every press (a\nb\n→a\n\nb\n→ …, unbounded); the phantom row is now excluded from the movable range, making bottom-edgeJ(and the symmetricKfrom the phantom line) a clean no-op.editor/buffer: fold follow-ups (0.0.24 feature, four holes found by a targeted sweep; regression tests inbugsweep_regression_test.odin). Normal-modezfcreated a fold spanning cursor↔stale visual anchor — chord resolution is mode-agnostic, so the visual-onlyzfexecuted in Normal mode against an anchor left behind by an earlier Esc'd selection (row 0 on a fresh buffer);_fold_cmd_create_visualis now gated on the visual modes. Visualzc/zasnapped the cursor out of the closing fold but left the selection anchor on a hidden line, so the screen showed one selected line whiled/yoperated on the hidden ones too;_fold_snap_cursorsnow snaps the anchor with the cursors.zM's full-file scan let a'literal-skip cross a newline (the"skip already bailed, as the doc comment promised for both), permanently desyncing its row counter — a quote pair straddling a line break shifted every later fold up one line; the'skip now stops at\n, in thezMscan and in_fold_enclosing_open's backward twin. Andddon the file's last line — which extends the delete back over the previous line's\n— read in the fold edit-carry as touching the previous line, silently opening a closed fold ending there even though that line's text was untouched:rope_delete/rope_insertnow journal edits anchored on a line's own newline (delete from\nto\n/EOF, insert of"\nT"at EOL/EOF) in the byte-equivalent whole-line form, so the fold and semantic-token carries treat them as pure line removals/insertions — the same shape mid-filedd/Oalready journal. Also:u(undo restore), swap recovery, and:maprebuilte.cursorwithout re-linkingcursor.folds— after any undo, all cursor motion and scroll math ran fold-blind for the rest of the buffer's life while the renderer stayed fold-aware, letting the cursor rest on (and vanish into) hidden lines; all three sites re-link, and:map/swap-recovery clear stale folds like:e/:helpdo.syntax: Odin, Swift, and Rust block comments nest per their language specs, but the highlighter closed the whole comment at the first*/— commenting out code that itself contained a/* */painted everything after the inner comment as live code (keywords coloured, trailing*/as operators), the exact miscue that makes disabled code look enabled. The scanner now counts/*/*/pairs for those three languages and carries the depth across lines in the previously-unused cross-line state bits 2–7; bit 0 still means "inside a block comment", so the fold detector's block-comment spans and every otherSTATE_BLOCK_COMMENTreader work unchanged. C/C++ keep the standard non-nesting behaviour. Tests incore/syntax/nested_comment_test.odin.lsp: the same file open in two panes sentdidChangewith independent per-pane version counters for one URI — pane A could push version 21, then pane B version 2, a regression forbidden by the spec (clangd refuses stale-versioned drafts; servers that accept it silently adopt the older pane's text and mislocate every diagnostic).didOpen/didChangeversions now come from a per-URI counter in the orchestration — monotonic regardless of which pane syncs — dropped when the last pane closes the document.debug: two DAP pause-tracking wedges. A failedstackTraceresponse (stopped thread exited before the request landed, transient adapter error) was only logged, leaving the client.Runningwhile the debuggee sat stopped — every step/:contno-op'd (they gate on.Paused) until disconnect; the failure path now disarms the pending pause and moves to.Pausedso stepping works. Andcontinued/terminatedevents never cleared the pending-pause latch, so astackTracereply arriving after a legal mid-flightcontinuedflipped the session into a phantom.Paused— UI jumping to a source line while the debuggee was actually running; both events now disarm the latch.debug/flutter: switching frames in[stack](Tab on a frame row) during a Dart/Flutter session ran the DAP wire path on a client with no DAP subprocess behind it — locals cleared, then ascopesrequest was framed into a buffer nobody drains (leaking a pending entry and growing the buffer on every switch), so the locals pane showed "(no locals)" until the next pause while watches half-updated through their own hook.select_framenow forks to a newon_select_framebackend hook like every other Dart-routed action; the VM-service side re-issuesgetStackflagged as a locals-only refresh — noset_pausedre-emit, which would snap the selection back to the top frame — and rebuilds the locals pane from the requested frame'svars. Watches already re-evaluate against the freshly-set active frame index.flutter: session-lifecycle hygiene.pop_event's nil guard wrote through the nil pointer it was guarding (if c == nil { c.has_current = false; … }— latent today, every caller pre-checks, but a guaranteed crash for any future drain path trusting it); a newflutter/dartsession inherited the previous process's partial stdout line and stale pending-request map, gluing the old tail onto the new session's first daemon message so it failed the[parse and the session's first protocol event was silently dumped to the log; andvm_disconnectcleared the VM-service pending map without freeing the heap-cloned breakpoint paths of requests still in flight. All three fixed (begin_session/begin_session_dartclearrx+pending; disconnect frees pendings before clearing).tags:Ctrl+]from a file opened by a relative path with a directory component (:e src/main.c— the Linux frontend stores paths as typed) never found the project root'stagsfile: the walk-up broke when the last path segment had no parent/instead of stepping to the cwd, sosrc/tagswas probed but./tagsnever was — while the same file opened asmain.cfrom insidesrc/resolved fine. The walk now steps to""(cwd) for relative paths; absolute walks still stop at the filesystem root.uri:file:///c%3A/...URIs — vscode-uri-based servers (pyright, typescript-language-server, dart) percent-encode the Windows drive colon — missed the drive-letter branch because the test ran against the still-encoded string (s[9] == ':'saw%), producing/c:/Users/...: diagnostics never matched the open buffer's path and goto-definition tried to open the invalid path.from_urinow percent-decodes first, then drops the leading slash on a decoded/X:/...pattern.theme: the threegitdiff_*colour roles could be read but not written —set_color's switch skipped exactly them, so:color gitdiff_added #00ff00(and the Luaeditor.theme.set_color) errored "unknown colour role" whileget_colorreturned the slot fine.set_colornow covers all three, and the:colorrole list in:helpgained the missinggitdiff_*+ghost_fgentries. All of the above: found by a four-way adversarial code sweep with every bug reproduced before fixing; built + full test suite onlinux(127core/editor, 75core/buffer, 20core/syntax, 22core/flutter, 11core/lsp, 46core/script— editor suite run 5× for the new tests' thread-safety), typecheckedwindows+macos(full frontends).editor/backup::swap-recovercould replace the buffer with an empty one — destroying precisely the unsaved work it exists to restore, and arming a:wthat would then flatten the on-disk file too.backup.readrouted both the raw swap file and the parsed copy throughcontext.temp_allocator, which during command dispatch is the per-editor 512 KB scratch arena: a swap larger than roughly half the arena made the parse'smake([]byte)come back nil while the parse still reported ok, and_swap_recoverspliced the empty result over the live rope, dirty flag set (swaps big enough to fail the raw read at least surfaced as "swap file unreadable"). The sibling swap paths (_swap_flush,_swap_check_on_open) already used the heap deliberately, with comments saying why; recovery was the one left behind. Now:_swap_recoverreads throughruntime.heap_allocator()and frees after the splice,backup.readputs the raw bytes on the caller's allocator instead of silently using the temp allocator (fixing the same hidden scratch-arena routing under_swap_check_on_open's heap call), and_parsetreats a failed allocation as a parse failure instead of ok-with-empty. Built + tested onlinux(4core/backup+ 106core/editortests); typecheckedmacos+windows(full frontends).editor: char-wise visual operations split a multibyte character at the selection's right edge. The inclusive end offset was computed as lead-byte+ 1, sov+d/x/con a selection ending overé/CJK/emoji deleted only the lead byte and left orphan continuation bytes in the rope — invalid UTF-8, renderer garbage, cursor-math desync — whilev+ycaptured a lone lead byte thatpthen spliced back into the buffer. Line-mode and block-mode were already codepoint-safe (block via_block_byte_bounds); only the char-mode end was wrong, in four places (_yank_visual,_delete_visual, visual~toggle-case, and the visual-selection:dbgeval capture). All four now go through a shared_visual_char_end_offsetthat widens the end past the codepoint's continuation bytes. Regression tests pin single-line delete/yank overéand a multiline selection ending on a multibyte char (core/editor/visual_utf8_test.odin).editor::s/<pat>/<rep>/with no range replaced the first match on every line from the cursor to end-of-file — the non-gearly-exit only broke the per-line column loop, and the outer row loop kept walking to EOF, one substitution per line (undoable, but a silent buffer-wide edit). Vim semantics restored: no range → current line only;:s/…/…/g→ all matches on the current line;:%sunchanged.:helpupdated (it documented the buggy "on/after cursor line"). Regression tests incore/editor/replace_cmd_test.odin.script:editor.handle_key(...)from Lua ran the key dispatch under the heap allocator — a mutating key allocated rope nodes on the heap and freed pool-owned nodes through libc free, i.e. heap corruption (or an allocator abort) on the first scripted edit._lua_handle_keynow installs the per-editor rope-pool + scratch allocators around the dispatch and resets the scratch arena after, exactly like_lua_run_commandalways did. Regression test drives a scriptedxand pins the buffer content (core/script/script_test.odin).lsp/debug: a bogusContent-Lengthheader could abort the whole editor. The shared JSON-RPC framer accumulated the header digits unchecked, so an i64-scale value overflowedheader_end + content_lengthnegative, slipped past the "enough bytes buffered?" guard (a length is never<a negative total), and panicked slicingrx[header_end:negative]; a merely-huge value instead parked the transport in.Need_Moreforever — every later byte buffered, LSP/DAP dead, memory unbounded.try_popnow rejects anything above 256 MiB as.Bad_Framing(both clients already treat that as a dead transport), with the cap checked inside the digit loop so the accumulator itself can never overflow. Tests cover the overflowing value, an above-cap value, and exactly-at-cap framing (core/jsonrpc/framing_test.odin).lsp: every protocol failure leaked a heap clone of the error message —_failclonedmsgbefore handing it to_set_str, which clones again and explicitly leaves the incoming string with the caller. Worse,.Bad_Framingdoesn't consume the offending bytes, so the same failure re-fired (and re-leaked) on every subsequentfeed_bytesfor as long as the server kept piping._failnow passes the borrowed message straight through. (DAP's_set_strtakes ownership; only the LSP copy had the double-clone.)chat: assistant text with\uXXXX-escaped emoji / supplementary-plane characters rendered as??— the stream parser's JSON string decoder mapped each UTF-16 surrogate half to a literal?instead of combining the pair. High+low pairs now decode to the real code point and emit 4-byte UTF-8; a lone or mismatched half keeps the?fallback. Tests pin😀→ 😀 and the lone-half fallback (core/chat/parser_test.odin).macos: two stale-timer bugs in the un-cancellableui_post_main_afterdelayed dispatches (Linux cancels these via timer tokens; the macOS port dropped the cancellation machinery). Shell: stopping a:!command armed a 2 s SIGKILL escalation carrying a raw session-slot pointer; if the command exited promptly and a new shell session claimed the recycled slot within the window, the stale escalation SIGKILLed the unrelated new process. The escalation now heap-captures the pid at arm time (same shape as chat_proc'sForceKill) and no-ops when the slot's pid no longer matches. Debugger: the 30 s adapter boot timeout acted on the globalg_dbg_procgated only on "still booting", so session A's stale timeout tore down a still-booting session B started<30 s later ("adapter timed out during startup" on a healthy session). The timeout now carries a per-arm generation counter and no-ops when it isn't the live arm — a generation rather than a captured pointer, since malloc can hand a new session the freed one's address. Typecheckedmacos(full frontend).windows: LSP/DAP/Flutter teardown freed (or zeroed) the session struct after waiting only 500 ms for the pipe reader thread — which keeps dereferencing that struct for every chunk and for its exitPostMessage. A reader still blocked inReadFilepast the window made teardown a use-after-free, with messages posted to a dangling HWND. Teardown now terminates the child first (the child's death is what reliably EOFs an anonymous pipe and unblocksReadFile— closing the read handle under a blocked read is UB, soout_readnow closes only after the reader is gone), waits 2 s checking the result, and on the pathological timeout deliberately leaks the struct (dbg/flutter) or abandons the static slot (lsp,in_usestays set so it's never recycled) with aWarnline in~/.editor.log— a bounded leak on an already-broken teardown instead of memory unsafety. Typecheckedwindows(full frontend).linux/macos: closing a chat pane whose agent had died with a large seeded prompt still unwritten could hang the entire UI thread. The idle-drain close path joined the writer thread without the SIGUSR1 kickfree_sessionuses — and a writer blocked inwrite()on a full stdin pipe (agent closed stdout, so EOF fired the close, but never drained stdin) blocks that join forever. The close path now kicks the writer before joining (the signal makeswritereturnEINTR, breaking its loop). Built onlinux; typecheckedmacos(full frontend).editor: opening a file could arm the crash-recovery prompt (backup found — :swap-recover / :swap-discard / :swap-abort, buffer forced read-only) with zero unsaved work behind it — most visibly after a git branch switch, where the mtime watcher reloads every clean buffer and each reload re-runs the swap check, but equally on plain re-opens and external file edits.~/.editor.backupsaccumulated swaps for files that were only ever viewed (dozens on a real setup, includinggd-visited Flutter SDK sources). Root cause:editor_note_mutationtreats a moved process-globalrope_op_seqas "this buffer mutated", but file loads run outside the key-dispatch wrap and never re-stampedlast_rope_op_seq— so the first keystroke after every open (even pure navigation) read the load's own rope ops as a user edit, callededitor_swap_mark_dirty, and —editor_set_contenthaving zeroedlast_swap_tick— flushed a swap for a clean buffer immediately. Any other buffer's rope activity between keystrokes (chat streaming, shell/grep output) false-fired the same way, and since swaps are only unlinked on save, viewed-only files kept theirs forever. Three-part fix:editor_swap_mark_dirtyis now gated one.dirty, so a buffer with no unsaved changes never grows a swap regardless of where the counter noise comes from;editor_set_contentre-stampslast_rope_op_seqafter the load (also killing the spurious full-textdidChangeon the first post-open keystroke — the "accepted trade-off" noted in the 0.0.23rope_op_seqentry no longer reaches the swap or didChange paths for clean buffers); and_swap_check_on_opensilently unlinks a swap whose bytes are identical to the just-loaded file, so stranded swaps from older builds self-heal instead of each demanding a:swap-discard. Real crash recovery is unaffected — every genuine edit setse.dirtybefore the swap path runs, and a swap that differs from disk still prompts, including the mtime-mismatch warning. Regression tests pin the clean-buffer no-op and the identical-swap self-heal (core/editor/swap_test.odin); built + tested onmacos(100core/editortests), typecheckedwindows(full frontend).panetree/lsp/macos/windows/linux: results-paneEnter,gd/Ctrl+](LSP and ctags), andCtrl+T(tag jump-back) loaded the target file into the focused pane, silently replacing whatever buffer that pane was showing — jump to a definition from a split and the file you were reading is gone, even when the target was already open one pane (or one tab) over. All jump paths now share one open-file policy: if the target is already open in some pane — in any tab — focus moves there (switching tabs if needed) with no reload, so unsaved edits and undo history survive; otherwise the file opens in a new tab; only at theMAX_TABScap (or without a load hook, on the LSP drain path) does the old replace-in-place behavior remain as fallback. Matching absolutizes both sides (grep rows and argv opens can be cwd-relative; Windows additionally slash-normalizes and case-folds), skips results panes, and prefers the active tab over duplicates in other tabs —find_editor_by_filename+focus_editor_any_tabincore/panetree, consumed by the results-pane goto and the ctags jumps in each frontend'sactions.odinand by the LSP definition drain (core/lsp/drain.odin). Same-file jumps still just move the cursor.:helpupdated (goto-definition,:find, results-pane sections).macos/windows/linux: mouse clicks landed on the wrong character in UTF-8 text — most visible withset wrap, where wrapped prose is exactly where wide glyphs live. The x→byte hit-test (byte_col_at_pxand siblings) still used the monospace model (one cell per non-ASCII codepoint), while the text — and, since the caret-alignment fix, the caret too — is laid out by the platform's real engine, where—/→/…/CJK/emoji paint two cells wide in Iosevka (and fallback glyphs at arbitrary advances). Every wide glyph left of the click shifted the resolved byte one cell further left of the pointer. Clicks now resolve through the same engine the text is painted with:CTLineGetStringIndexForPositionon macOS (new binding),IDWriteTextLayout::HitTestPointon Windows (vtable slot typed), andpango_layout_xy_to_indexon Linux (new binding, against the renderer's cached layout with its font + tab array). The hit-test also runs against exactly the bytes painted on the clicked visual row — the wrap sub-row segment (visual_row_advance), not the rest of the line — so a click right of a sub-row's last glyph clamps to that sub-row instead of walking into the next one. Pure-ASCII lines keep the exact byte-model fast path and skip the layout allocation; drag-selection goes through the same helper. Also: macOSct_glyph_width(caret metrics) now measures with the painted attrs (font + tab paragraph style) so a tab after a non-ASCII glyph measures on the editor's tab grid rather than CoreText's default stops. Runtime-verified onmacosvia syntheticmouse_handle_presscalls against a live Iosevka render: clicks after a———prefix resolve to the pointed glyph (old model was 3 cells off) on both wrap sub-rows, and the sub-row start byte survives the byte/cell distinction; typecheckedwindows+linux(full frontends).macos/windows: LSP diagnostic squiggles were invisible withset wrap— the squiggle pass was gated on wrap being off, so any diagnostic (all languages, even on lines short enough not to wrap) painted nothing while:diagstill listed it; reported as "dart LSP doesn't highlight errors" because dart buffers are where wrap + LSP met in practice. Linux was already correct (pane_paint_diagnosticsclips each diagnostic to the visual segment). macOS now paints the overlap of[col_start, col_end)with each visual row's segment using the same clip rule; Windows walks visual rows with the sameeditor_wrap_row_advance_csegment math as its text loop and paints per-segment overlaps, so a squiggle lands on the right sub-row and follows a diagnostic across wrap boundaries. Non-wrap paths unchanged on both. Runtime-verified onmacosagainst a livedart language-serversession (squiggle tracks a 300-char error string across three wrapped visual rows); typecheckedwindows(full frontend).buffer/editor/lsp: typing blinked the LSP semantic-token colours off — every rope mutation bumpsrope_version, so the 0.0.23 staleness gate ineditor_apply_semantic_tokenshid the whole overlay from the keystroke until the server's recomputedsemanticTokens/fullresponse landed (50–300 ms; continuous typing kept it hidden throughout, so the buffer snapped between lexer-only and fully-coloured on every pause). The overlay is now carried across edits instead of hidden:rope_insert/rope_deleterecord each op into a process-global ring journal (Edit_Op: old/new root, pre-edit(line, col)edit range computed from the cached subtree newline counts, inserted bytes/newlines) alongside the existingrope_op_seqbump, andeditor_note_mutationreplays the ops in(last_rope_op_seq, rope_op_seq()]whose roots chain from the pre-dispatch root to the live rope, shifting the cached token positions in place — tokens before the edit stay, tokens after shift by the line/col delta, tokens overlapping the edit drop until the next response, except a same-line insert strictly inside a token, which grows it so the identifier under the caret keeps its colour while being typed into — then re-stampssemantic_tokens_versionso the gate keeps passing. Chain matching can't cross buffers (per-editor rope pools are disjoint reservations, so a foreign root never aliases the chain tip), handles the ~43% freelist ABA root-address reuse (the journal keys on op sequence, not pointer identity), and turns the documented false-positive bump from another buffer's rope op into a carried overlay instead of a blink (rope unchanged ⇒ empty chain ⇒ carry succeeds). On carry failure (undo rope swap, journal overflow from >128-op bulk edits like:%s) the version stays stale and the overlay hides exactly as before, self-healing on the next response.set_semantic_tokens_from_eventadditionally refuses to clobber a newer carried cache with a response computed against an older rope — replacing it would re-arm the gate mid-typing while the chase re-request is still in flight. Tests:core/buffer/edit_journal_test.odin(journal positions for same-line/multiline insert, cross-line delete, delete-all fallback-leaf chaining) andcore/editor/semantic_tokens_carry_test.odin(col shift, inside-token grow, Enter mid-line move, cross-line delete join, multi-op dispatch, undo-swap fallback, already-stale skip, foreign-op survival). Built + tested onmacos(58core/buffer+ 98core/editor+ 11core/lsptests), typecheckedwindows(full frontend).linux: the character under the block cursor showed a ~1px bright "offset ghost" outline, and the block itself could have fuzzy edges sitting up to a pixel off the glyph. Two compositing defects inpane_paint_cursor_at: (1) the block tint (cursor_block, default 35% white) was painted straight over the already-drawn syntax-coloured glyph, so the bright original stayed visible under the near-blackcursor_charrepaint — every antialiased edge showed as a light halo around the dark glyph (FreeType's thin grayscale AA makes this far more visible than CoreText/DirectWrite, where the same double-draw hides under fatter rasterization); (2) the block rect was drawn at the raw fractional Pango x (layout_index_to_posreturns unhinted HarfBuzz advances), while cairo/FreeType snaps glyph ink to whole pixels, so the rect's antialiased edges misaligned with the glyph. The cursor cell is now snapped to the pixel grid (floor/ceil), erased to the theme bg, and then the block tint +cursor_charglyph are painted — the glyph is drawn exactly once. Applies to primary and extra cursors (shared helper); the insert-mode caret x is snapped too. Verified by replicating the pango/cairo pipeline in isolation on the FreeType fontmap: the repaint was confirmed pixel-exact against the line render in every hint-style/hint-metrics combination (ruling out a real position bug), and a before/after render shows the halo + fuzzy edges gone; typecheckedlinux(full frontend).run/flutter: a failed:rundestroyed its own error output — when theflutter run/dart run --enable-vm-servicesubprocess died on its own (compile error, bad flavor, device gone), the EOF-driven teardown closed the[flutter run]/[dart run]pane, taking the exact text the user needed with it (:helpeven promised the pane stays open). Teardown now takes aclose_panesflag: the natural-exit path keeps the log pane, appends a[dart|flutter] process exited (code N)line (exit code reaped viawaitpid(NOHANG)on POSIX /GetExitCodeProcesson Windows; if the child is somehow still alive the kill path runs and the line prints without a code), drops the pane to picker kindNoneso the standard results bindings apply (q/Escclose it — same shape as shell panes keeping their exit-code label), and sets status… exited — q closes the output pane. Picker and debug panes still close on natural exit (the VM behind them is gone). Explicit stops (qwhile running,:run stop, hot-restart relaunch, shutdown) passclose_panes = trueand clean everything up as before. All three frontends. Runtime-verified on macOS by driving a failingdart runsession and snapshotting the frame — pane retained with the compile errors + exit line; typecheckedwindows+linux(full frontends).buffer/editor: LSP semantic-token colours could land mid-identifier after an edit — "spots", e.g. one slice of a class name type-blue, the next plain, the rest function-sapphire — and stay wrong until a later keystroke happened to resync. Root cause:editor_note_mutationdetected edits by pointer compare (e.rope != before), but the rope pool's LIFO freelist recycles orphaned spine nodes, sorope_insert/rope_deletecan hand back a new root at the old root's exact address — measured at ~43% of random single-char edits on a multi-leaf rope. A missed bump meant notextDocument/didChangefor that edit and an unmovedrope_version, so the 0.0.23 stale-token gate kept passing and the overlay painted tokens computed against the pre-edit text onto the edited buffer. The same missed bump also staled the git-diff gutter and the block-comment syntax cache and skipped the crash-recovery swap flush for that edit. Fix: a process-global atomicrope_op_seqcounter bumped by every content-mutating rope op (rope_create/rope_insert/rope_delete), consulted byeditor_note_mutationalongside the pointer check — this covers every mutation path (key dispatch, undo restore, the frontends' drag-drop moves) with no frontend changes and still skips pure-navigation keys. Accepted trade-off: a rope op on another buffer (e.g. chat-pane streaming) between keystrokes now costs one redundant full-textdidChange; move the counter ontoRope_Poolif that ever needs tightening. Regression tests:core/bufferpins that the op sequence advances even when the root address is reused (and that the reuse actually occurs, so the test can't go vacuous);core/editorpins the bump for the reused-root case and the no-bump for pure navigation. Built + tested onmacos(54core/buffer+ 90core/editortests), typechecked onwindows(full frontend) andlinux(changed core packages).
Changed
linux/macos/windows: quitting (:qor closing the window) now autosaves the loaded project session, so the final cursor positions and closed folds are what a relaunch restores — previously session state was only as fresh as the last structural autosave (split, file open/close, breakpoint, watch), and anything after that was lost at exit. Guarded bysave()refusing to write a zero-tab session, so the:qpath's teardown ordering (pane tree destroyed before the main loop exits) can't wipe the project file with an empty tree; the window-manager close path saves from the post-loop teardown while the tree is still alive.
0.0.23
Added
run/flutter: plain-Dart support —:run type dartis a third run type alongsidenativeandflutter, auto-selected frompubspec.yaml(ansdk: flutterline ⇒ flutter; any other pubspec ⇒ dart; none ⇒ native).:runstreams the run command (defaultdart run) in a shell pane with no debugger;:run debugspawnsdart run --enable-vm-service=0 --pause-isolates-on-start [target…](target from:run debug set, e.g.bin/server.dart --port 8080; empty means the package's default executable) and attaches the existing Dart VM-service debugger, so breakpoints, stepping, locals/watches, eval, and:run exceptionswork exactly as under Flutter — with the start pause held until queued breakpoints flush, so breakpoints land beforemain()(release deferred until the flush, guarded against double-resume for the connected-before vs connected-after cases). Dart sessions are hosted by the Flutter daemon client in a raw-stdout mode: no--machineJSON framing — every line is program output (a program printing[1, 2, 3]must not be eaten by the daemon parser) — and the debugger endpoint is scraped from the firstThe Dart VM service is listening onbanner (http→ws,/wsappended; later banners ignored). Hot reload (r/:run reload, auto-fired on.dartsave) goes through the VMreloadSourcesRPC; hot restart is kill + relaunch, since a CLI Dart VM can't restart in place. The output pane is[dart run]with the same keys. Each frontend'sflutter_procgained a shared launch path plus dart CLI resolution ($DART/%DART%, flutter checkouts, fvm, dart-sdk, PATH). Tests incore/flutter/session_dart_test.odin(banner→ws conversion, raw-log dispatch, once-only URI publish, both pause-on-start release paths).syntax/lsp/run: Ada + Alire support..adb/.ads/.ada/.gprfiles get syntax highlighting — case-insensitive keyword/type tables (matched allocation-free via a byte-folding compare),--line comments (Ada is excluded from the//and/* */handlers),""-doubling string literals with no backslash escapes, based/underscored numerics (16#FF#,2#1010_1010#,1_000_000,1.0E-6), and three-way tick disambiguation so'a'lexes as a char literal,'Access/'Firstas attributes, and the qualified-expression tickT'(…)as an operator. LSP routesada+gprbuffers toada_language_server(start the editor from the crate root — ALS wants the unique.gprand thealrtoolchain env there; documented in:help). Analire.tomlat the project root defaults the run config —alr build/alr run/ debug targetbin/<crate>(crate name parsed fromexecutables = […]orname =in the root table) — without overriding user-set values, so:run debugchainsalr build→lldb-dapon the crate binary (GNAT's development profile emits DWARF that lldb-dap consumes as-is).gccomment-toggle maps the Ada extensions to--; help.md syntax/LSP/run tables updated. Lexer tests incore/syntax/ada_test.odin.lsp: Python support + per-language server overrides..py/.pyw/.pyibuffers route topyright-langserver --stdio, andgctoggles#comments. New:lsp server <lang> <cmd> [args…]overrides which server a language spawns (e.g.:lsp server python /usr/local/bin/pylsp -v;:lsp server <lang> defaultrestores the built-in; bare:lsp serverlists overrides) — an override shadows the built-in for that language only and takes effect on the next spawn. Covered bycore/lsp/orchestration_test.odin.
Fixed
lsp: semantic-token colours stayed painted through the window between an edit and the server's recomputed response — the cached token positions describe the pre-edit rope, so colours sat on the wrong columns until the next response landed.editor_apply_semantic_tokensnow skips the overlay when the tokens' stampedrope_versiondoesn't match the live rope (falling back to lexer colours for that round-trip); the existing sync/drain machinery already chases the fresh response.editor: the trailing-whitespace indicator was skipped entirely on soft-wrapped lines — the fill was gated on wrap being off, and the pixel math assumed the measuring layout held the whole logical line rather than one visual segment. The trailing run is now computed on the logical line and painted per visual row as its overlap with that row's segment, measured against the segment's own layout. Applied to all three frontends (linux/macos/windows).linux: three X11 robustness fixes. Large pastes from other apps arrived empty — selections above the max-request size use the INCR protocol (the owner streams chunks viaPropertyNotifyuntil an empty chunk), which the clipboard reader detected but didn't implement; a full INCR receive path now accumulates the chunks into the paste (window event mask extended withPROPERTY_CHANGE; transfer buffer freed on shutdown/failure). The XIM client was never told about window focus changes;FOCUS_IN/FOCUS_OUT(filtered for grab pseudo-focus) now forward to the IME so preedit state follows the window. And a watched fd dying (X connection or eventfd) busy-spun the main loop at 100% CPU —poll()returned instantly withHUP/ERR/NVALthat nothing consumed; those conditions now break the loop for a clean shutdown.macos/windows: on tab-indented lines drawn by the plain-text path, painted tabs used the text engine's default tab stops while the caret/selection/mouse math used the editor's 4-space grid, so the block cursor drifted off its glyph. CoreText's per-row attributes now carry a paragraph style that clears the ~28pt default stops and setsdefaultTabIntervalto the editor's tab grid; DirectWrite getsSetIncrementalTabStop(tab_stop_px)(its vtable entry was an unboundrawptrand is now properly typed). Linux already painted tabs on the caret's grid.panetree: a queued separator drag arriving after a pane close (or tab switch) but before the next paint wrote the split ratio into freed memory —drag_sepresolves the separator through a layout cache that onlycompute_layoutrefreshed, so pane-freeing mutators left stale^Panepointers behind a still-passing bounds guard. Every mutator that frees a pane or switches tabs now invalidates the sep/layout caches, making the guard load-bearing (a stale drag no-ops; the next paint rebuilds). The rest of thecore/panetree/REVIEW.mdbacklog was cleared in the same pass: a package-header threading contract (UI thread only), both leaf-destroy paths routed through one_destroy_leafso the destroy notification can't be skipped, a non-nil focus fallback after close, allocation-order/nil-guards insplitand_pane_new_leaf, aMAX_PANEScap at the construction site (excess panes used to exist in the tree but be invisible and unfocusable), andset_active_tabreturningbool. Newcore/panetree/panetree_test.odin(8 tests, including one pinning the stale-drag no-op).macos/windows/linux: the block cursor could sit on the wrong glyph — a garbled, half-overlapping character in the cursor cell — when the line held a wide CJK/emoji or a fallback-font glyph before the caret. Most visible with line wrap on, since wrapped prose is where such characters show up. The caret's x-position was computed with a monospace model (pixel_x_of_byte/pixel_x_and_width, one cell per non-ASCII codepoint) while the text is painted by the platform's real engine at each glyph's true advance, so the opaque block drifted off its glyph and left a sliver of the neighbour poking out beside the overlay. The caret now measures its x through the same layout the text is painted with: CoreTextCTLineGetOffsetForStringIndexon macOS (engaged only when a non-ASCII byte precedes the caret — the exact ASCII/tab fast path is untouched), DirectWriteHitTestTextPositionon Windows (now done unconditionally, so a caret on a tab or past EOL is exact too, and the extra/multi-cursor path was routed through the samecursor_metrics_dwriteinstead of the monospace helper), and Pangolayout_index_to_poson Linux (the primary caret already used it; the extra-cursor path was switched off the monospacepixel_x_and_width). Fixes both wrap-on and wrap-off, since the same caret-metrics path runs in both.core/editor: a batch of correctness bugs surfaced by re-verifyingcore/editor/REVIEW.mdagainst current code (all were still present):- visual-block yank/delete on non-ASCII text.
_yank_visual_blockcopied the byte at a constant column (line_off + 1, not+ i) and ignored its own codepoint-widened bound, so<C-v>block yank produced repeated copies of one byte;_delete_visual_blockcut the rectangle mid-codepoint, leaving invalid UTF-8 in the rope. Both now widen the column range to whole codepoints via a shared_block_byte_boundshelper. - multi-cursor
>/<(indent/dedent) shifted the line text but left every extra cursor at its old column; they now track the inserted/removed indent. :help/:mapinherited a stale crash-recovery swap prompt armed on the previous file — a ghost prompt no command could dismiss. Both virtual buffers now clear the swap state like:e.- accepting an autocomplete/snippet float on a read-only buffer mutated it (the
_mutatesread-only gate only covered the enum-dispatch path); the float-accept path now honourse.read_only. %bracket matching treated'{'/'}'char literals as real brackets and mis-paired; it now skips char literals (bounded, escape-aware), mirroring the existing string skip.- grep/result rows beginning with a smart quote or zero-width space (any other
0xe2-lead character) became non-clickable, because the─separator was matched on its lead byte alone. The full U+2500e2 94 80sequence (and U+25B6e2 96 b6for the ▶ run marker) is now matched. - the autocomplete float only closed on a hardcoded list of cursor/viewport keys, so a newly-added
Keyenum value silently left it open; it now default-closes on any key it doesn't explicitly handle. - block comments (
/* */) no longer trigger a wasted LSP completion request — the completion gate is now block-comment aware, seeded from the cross-line syntax cache and gated to/* */languages so Python triple-quotes / Markdown bold (which reuse the same state bit) can't cause a false suppression. <C-W>and other uppercase single-letter ctrl tokens now parse in~/.editormappings (were lowercase-only, so pasted vim bindings errored).- a
cmd_keysmapping to an unknown command name now shows a status message instead of a silent no-op. - a chord first key typed immediately after an over-long chord is now recognised as a chord prefix on the same keystroke instead of one keystroke late. Built + tested on
macos(88core/editor+ 53core/buffertests pass); typechecked onwindowsandlinux.
- visual-block yank/delete on non-ASCII text.
Changed
buffer: the rope pool's 1 GiB backing block is allocated through Odin'sruntime.heap_allocator()instead of rawlibc.malloc, dropping thecore:c/core:c/libcimports fromcore/buffer/pool.odin. Same lazy page-commit behaviour, failure handling, and lifetime semantics; no behaviour change.core/editor: cleanup from the same review pass. The:fl/:flifloating-pane demo command was removed (superseded by LSP-driven completion). SetMark now uses a dedicatedpending_mark_letter: runefield instead of overloadingpending_colas scratch (core write + all three frontends'action_set_mark).:maprejects a 4th argument token instead of silently dropping it;:color[!]parsing computes one prefix length instead of two literal offsets.core/editor/REVIEW.mdwas updated with per-item FIXED 2026-06-29 notes and a header note that itsapi.odin:NNNNcross-references are now dead (the C-ABI layer was removed; the boundary bump iseditor_note_mutation). No behaviour change beyond the items listed.
0.0.22
Added
core/linux/macos/windows::runis now a single, project-driven launcher that behaves the same for every project, instead of implicitly falling through to Flutter. A project declares a run command and a run type;:runlaunches without a debugger and:run debuglaunches with one, with the backend chosen by the type. native (default)::runstreams the run command in a shell pane;:run debugruns the project build command (:run build set <cmd>) and, only on a clean exit, launcheslldb-dapon the debug target (:run debug set <binary>, falling back to the run command) — so build-and-run toolchains likeodin build . -debugbecome debuggable even thoughlldb-dapneeds a real binary. flutter: launchesflutter run --machine+ the Dart VM debugger / hot reload as before, but is now an explicit type (auto-selected from a rootpubspec.yaml) rather than the silent fallback. New verbs::run set,:run debug set,:run build/:run build set,:run type native|flutter;:run stop/:run restartare type-aware. The standalone:dbg <program>/:dbg setlaunch verbs are folded into:run debug(:dbgkeeps status/stop/restart/panes/inline and:dbg-test). Run config (run/debug/build commands + type) persists in.editor.prj, with legacydbg_cmdfiles migrating cleanly. The build→debug chaining lives in each frontend'sshell_proc(a shell session can carry a debug target that fires on exit 0); core dispatch,:help, cmdline completion, and the space menu were updated, withcore/editor/run_dispatch_test.odincovering the dispatch matrix. Built + tested onlinux, typechecked onmacos/windows.
Fixed
debug: hitting a breakpoint loaded the stopped file into the focused pane even when another pane was already showing that file — duplicating it into a second pane (most visible with:run debug, where the just-finished build pane held focus). On PAUSED the debugger now reuses a pane already displaying the file (jump + center, no reload), and only falls back to loading into the focused/first source pane when none has it. Applies to native (lldb) and Flutter pauses alike; fix is incore/debug/orchestration.odin.
CHANGED
windows: follow-up sweep of vestigialproc "c"shims andrawptrceremony that the cross-platform C-ABI removal left behind. File-private shims inwindows/{actions,chat_proc,chat_oneshot,clipboard,completion,dbg_proc,draw,draw_core,editor_view,flutter_proc,flutter_vm,git_diff,icon,lsp_proc,main,pane_tree,path_utils,search}.odinno longer carry C calling conventions or thecontext = runtime.default_context()prologue, and shims that only have Odin callers now take^ed.Editor/^dbg_pkg.Client/^flutter_pkg.Clientdirectly instead of round-tripping throughrawptr.AppState.completionandAppState.flutter_coreare typed for the same reason; the few remainingrawptrfields are the ones whose owners are@(private="file")(commented inline). Stale "port of windows/X.c" / "byte-for-byte mirror" header comments were refreshed — the port is done. No behavior change.
0.0.21
Changed
core/linux/macos/windows: removed ~1600 lines of vestigial C-ABI scaffolding from the three frontends and from the cross-frontend orchestrators that fed them. Now that every frontend is pure Odin importingcore/directly (nolibeditor.*, noapi.h), theproc "c"calling convention,context = runtime.default_context()prologue,@(export, link_name=…)decoration, libc-malloc'd-cstring return shims, andeditor: rawptrparameters that the old FFI layer required were dead weight on every same-package call. The pane-tree API (core/panetree) was retyped end-to-end (focused_editor,split,new_tab,close_focused,active_tab_editors,all_editors,contains_editor,focus_editor,tab_focused_editor,pane_leaf_editor,Layout_Entry.editor) so^ed.Editorflows through it instead ofrawptr; the LSP/DAP orchestrators' source-pane picker (core/lsp/orchestration,core/lsp/drain,core/debug/orchestration,core/project/project) followed. Each frontend'sactions/file_io/git_diff/shell_proc/flutter_proc/dbg_proc/lsp_proc/chat_proc/chat_oneshot/search/busy/font/main/draw/mouse/keys/editor_view/app_state/core_shimswere swept to match: editor params became^ed.Editor, public shims return Odinstringinstead of libc-malloc'd[^]u8, magic-number action/picker constants (EDITOR_ACTION_*,EDITOR_PICKER_*,PANE_HSPLIT*) were replaced with theed.Action/ed.PickerKind/panetree.Pane_Kindenums they shadowed, and dead@(export)exports plus thePane/PaneLeafstub mirrors inlinux/app_state.odinwere deleted.proc "c"now only appears where there's a real C-ABI boundary on the other side (Direct2D/DirectWrite COM vtables, Core Graphics/AppKit bindings, Win32WndProc, thread entries, signal handlers, IME callbacks, the chat ghost-text hook layer, and the project/debug cross-package file-load typedefs). No runtime behaviour changes. Verified bymake linuxandodin check macos/windows.
Added
syntax/lsp: Rust support..rsfiles now get syntax highlighting (keywords, types,//and/* */comments, char/string literals, raw stringsr"…"/r#"…"#/br"…", and lifetime-vs-char disambiguation so'a/'staticare coloured as labels rather than mis-lexed as an unterminated char literal) and route to arust-analyzerlanguage server, lazily spawned for.rsbuffers like every other entry in the server map.//comment-toggle (gc) and the:helpsyntax + LSP tables were updated to match.
Changed
build/core: removed the dead C-ABI export layer —core/api.odin(~5.9k lines) andcore/api.h(~1.9k lines). Since the Windows port every frontend is pure Odin importingcore/subpackages directly; nothing in any shipped binary linked the rootcorepackage or alibeditor.{so,dylib,dll}, so the header/export pair only existed for on-demand FFI-parity targets that are no longer used. The Makefile's threelibeditor.*shared-lib targets and thelinux/.core-checkedguard (which existed solely to type-check the now-deletedapi.odin) are gone, along with thecore/api.hbuild-prerequisites. The per-editor allocator-context setup that used to live in the FFI exports already moved into thecore/editorentry procs, so no runtime behaviour changes;CLAUDE.mdwas updated to drop the FFI-boundary sections.
Fixed
macos/linux: LSP coloring/diagnostics/completions drifted from the buffer (most visible with dart-analyzer) — typed edits never reached the server. The C-ABIeditor_handle_keyexport bumpedrope_versionwhen the rope changed, but the FFI-removal port dropped that bookkeeping from the macOS/Linux key dispatch (Windows kept its copy ineditor_view.odin), sosync_buffersaw no version change and never sentdidChange: the server kept analysing the file as opened. The same lost block also marked/flushed the crash-recovery swap, so swap files stopped being written for typed edits on those platforms. Both restored via a sharededitor_note_mutationcore helper, applied in_dispatch_key, the external-paste path, and the cmdline-picker accept path (which now also runs under the editor's pool allocators like every other rope-mutating entry point).lsp: after a semantic-tokens response, if the buffer had moved on while the request was in flight the colours stayed misaligned until the next keystroke (sync_bufferonly runs on key dispatch). The drain now immediately re-requests when the answered version is older than the last synced one, so colours converge one round-trip after a typing burst.lsp: an error /nullsemantic-tokens result (dart-analyzer answersnullwhile still analysing) wiped the editor's token cache, flashing the buffer back to lexer-only colours. The existing cache is now kept and the request version reset so the next sync retries.panetree: pane splits (and:tabe,Ctrl+W H/J/K/L) allocated theirPanenodes — and the new pane'sEditorstruct — with the ambientcontext.allocator, which during key dispatch is the focused editor's rope pool. The next reload of that editor (:e, save-watcher, or the external-change watcher above) reset the pool and freed the live pane-tree nodes; the reloaded file's rope leaves reused the memory, so the tree'ssplit.a/split.bfields filled with buffer text and the next draw's layout walk dereferenced it — SIGSEGV in_computewith an ASCII fault address (e.g.0x746469772074656c= "let widt"). Pane/tree nodes and theEditorstruct are now explicitly heap-pinned (new(_, runtime.heap_allocator())with matching frees), the same treatmenteditor_create's dynamic arrays already got for the semantic-tokens variant of this bug. Fix is in core, covers all three frontends.editor: external file changes could permanently stop showing up in the editor (most visible after switching focus away while an agent/tool wrote the file in rapid bursts). The file watch stored the buffer's mtime at whole-second granularity after reading the content, so a second external write landing in the same second as a watcher reload (or during the read itself) leftstat-mtime equal to the stored value — the equality check never fired again and the buffer stayed stale until:e. Same latch as thegitdiffindex-watch fix below, applied to the buffer watch: the mtime is now captured before the content read and stored/compared at full precision (tv_sec*1e9 + tv_nsecon macOS/Linux; Windows already compared FILETIME ticks but also stat'ed after the read). Verified focus is not a factor for single writes — the 2 sNSTimerkeeps ticking unfocused and fully occluded; macOS additionally now polls immediately onapplicationDidBecomeActiveso a refocus shows external changes without waiting for the next tick.macos::vsp <file>/:sp <file>(and the no-arg forms) split the pane but left it empty ([No Name]).ev_keyDownresolved its dispatch target viafocused_editor()afterkey_handle— but split/tab actions are absorbed insidekey_handle(panetree.absorb_action) and move focus to the new pane, soaction_splitlooked forpending_file(and the fallback filename) on the freshly created empty editor instead of the one that ran the command. The focused editor is now captured beforekey_handleand used for the dispatch, matching the capture-before pattern Linux (handle_key) and Windows (dispatch_key) already use. Same fix covers:tabe <file>and file-loading actions accepted from the cmdline picker.gitdiff: the index watch compared mtimes at whole-second granularity on macOS/Linux, so whengit addandgit commitrewrote the index within the same second (typical for scripted/agent-drivengit add -A && git commit), a watcher tick landing between the two writes stored the pre-commit mtime and the equality check never fired again — stale gutter until the next index change. The watch now stores and compares full-precision mtimes (tv_sec*1e9 + tv_nsec); Windows already compared FILETIME ticks and needed no change.gitdiff: the gutter never refreshed after a commit when the file lives in a git worktree (or submodule). The refresh stored<repo_root>/.git/indexas the file-watch path, but in a worktree.gitis a redirect file (gitdir: <path>), not a directory — thestatfailed, the watch mtime was stored as0, and the 2-second watcher'smtime == 0guard then skipped the editor forever, so stale hunks stayed in the gutter until:e.git showitself follows the redirect, which is why marks looked correct at load and only the refresh-on-commit was dead. The repo root's.gitentry is now resolved through the redirect (absolute and root-relativegitdir:forms) and the watcher polls<gitdir>/index; the status-bar branch is read from<gitdir>/HEAD, so it now also shows the correct per-worktree branch. Applied to all three frontends (macos/linux/windows); regression test for the post-commitset_headinvalidation added incore/gitdiff/refresh_test.odin.editor: the status bar could overlap the git branch in narrow panes. The left segment (-- MODE -- filename [+]) and the right segment (branch row:col) were measured and drawn independently, so in a pane too narrow to fit both they printed over each other. The bar now sheds detail in priority order instead of overlapping: the file path first collapses to its basename, then the branch name hides, and only as a last resort is the filename dropped (mode + flag only) —row:colalways stays. Applied to all three frontends (macos/linux/windows);:helpstatus-bar section updated.editor: inline ghost text blinked out for a round-trip when you typed a character matching its head in LSP suggestion mode. The matching keystroke fell through to the completion / signature-help auto-fire, which cleared the ghost and waited for the server to repopulate it. The typed-through case now trims the consumed head and re-anchors the remaining ghost in place via a shared_ghost_typed_trim(AI mode also cancels the pending debounce / in-flight request so a stale response can't overwrite it), and the LSP/AI auto-fire is suppressed for that keystroke. Regression test incore/editor/ghost_typed_through_test.odin.editor: buffer text to the right of the cursor was overdrawn by inline ghost text instead of being moved aside. The trailing text now shifts right by the ghost's rendered width so both the suggestion and the existing line tail stay readable. Applied to all three frontends (linux/macos/windows).linux: a failed atomic save could surface a corrupted destination path (rope text bleeding into the displayed filename) in the error message. The save path operated on the caller's borrowedpathcstring, which lives in the action handler's temp allocator; switchingcontext.temp_allocatortoep.scratchplus the per-linearena_free_allshouldn't reach that arena, but the path was still observed corrupted with rope content duringrenamefailures. The save now takes a stable libc-owned copy ofpath(and<path>.tmp) up front and uses it for every syscall,stat, and error message; a rename failure also writes a diagnostic record (tmp/target/errno) to~/.editor.log.build/macos:make installcould leave the installededitorgetting SIGKILL'd at launch with "Code Signature Invalid / Invalid Page".install-macusedcpto overwrite~/.local/bin/editorin place, which reuses the inode — and macOS caches a code-signed binary's cdhash per vnode, so the kernel validated the freshly built adhoc/linker-signed binary's pages against the previous install's cached hash and killed it at page-in, even thoughcodesign --verifyreported the on-disk file as valid. The destinations are nowrm -f'd before the copy so each install lands on a fresh inode the kernel validates cleanly.
0.0.20
Fixed
notify: notification-box text could overflow its right border. The overlay clamped its box width towin_w/3but never clipped the drawn text, so any message wider than a third of the window spilled past the border — most visibly the chat spinner status (pushed into the notification stack every 80 ms viaeditor_set_status_str→notify.push), whose trailing braille spinner glyph dangled off the pane. The width cap is raised towin_w - 2*marginso the box grows to fit its text, and a clip rect now wraps the text draw as a hard guarantee that content can never escape the box. Applied to all three frontends (macos/linux/windows).macos/windows::wsilently failed to save (regression from the Odin frontend port). Therope_get_lineshim calledfree_all(context.temp_allocator)per line, wiping the shared default temp arena out from under its callers — including the save path's destination-path cstring, so the final atomicrename(tmp, path)ran with an empty destination and failed with ENOENT (macOS), and the post-save mtime stat used a clobbered path so the file watcher saw a phantom external change (Windows). The shims now release only their own allocations via a scoped temp region (default_temp_allocator_temp_begin/_end).linux: saving a file larger than ~512 KB silently truncated it — the save loop allocated every line from the fixed 512 KB scratch arena and only reset it once at the end, sorope_get_linereturned empty lines after the arena filled. The arena is now reset per line.macos: dropped debug logging left over from thestat_app→posix.statmigration.check_file_changeswrote two records to~/.editor.logon every 2-second watch tick for every open editor, steadily growing the log file; thestatcall is now inline with no logging and the mtime-reload logic is unchanged.
0.0.19
Added
editor: inline ghost-text suggestions (phase 1 — core plumbing) — dim text after the cursor in Insert mode;Tabaccepts and inserts it into the buffer; any other motion or mutation clears it. Source-agnostic state onEditor(ghost_text/ghost_pos/ghost_source) pluseditor_set_ghost_text/editor_get_ghost_textFFI;:ghost <text>test command drives it manually until LSP / Lua / AI sources land in later phases. New theme slotghost_fgcontrols the colour across all three frontends.editor: inline ghost-text suggestions (phase 2 — LSP source) —:set inline_suggestions lsp(add!to persist) auto-fires the LSP completion request on every word character in Insert mode and renders the top candidate as ghost text after the typed prefix;Tabaccepts. ExplicitCtrl+Spacestill opens the autocomplete float.editor: inline ghost-text suggestions (phase 3 — Lua source) —editor.set_ghost_text(text)/editor.clear_ghost()/editor.get_ghost_text()pluseditor.on_text_changed(fn)let user scripts drive ghost text from any source (local dict, remote model, Copilot proxy) without touching the core. The hook fires after every mutating command with{row, col, byte_offset}.editor: inline ghost-text suggestions (phase 4 — AI source) —:set inline_suggestions aidebounces 250 ms after every keystroke in Insert mode, POSTs the prompt directly to the Anthropic Messages API viacurl(haiku by default) with ~200 lines of context above the cursor + ~50 below, and renders the response as multi-line ghost text. Theclaude --printCLI was the original target but its ~60 s start-up cost made the path unusable; the direct API call returns in 1–3 s. Requirescurlon$PATHandANTHROPIC_API_KEYexported. New partial-accept keys:Ctrl+Rightaccepts one word,Ctrl+Downaccepts one line,Tabaccepts everything. Cost-guarded by:set ai_suggestions_max_per_minute N(default 20). Implemented across all three frontends:linux/chat_oneshot.c(posix_spawn + reader/writer threads +ui_post),macos/ChatOneshot.swift(FoundationProcess+DispatchQueue.main),windows/chat_oneshot.c(CreateProcessW + reader thread + WM_APP message).debug: run-to-cursor via:runto— sets a one-shot breakpoint at the cursor line and continues; the breakpoint is auto-removed when execution stops there (viahitBreakpointIdsor file:line fallback).debug: conditional breakpoints via:break if <expr>— condition is sent as DAPSourceBreakpoint.condition, persisted in.editor.prj, and shown in:breaks.debug: hover-evaluate on a paused session —Kin Normal mode sends DAPevaluatewithcontext:"hover"and shows the result in the hover float; LSP hover is the fallback when no session is paused.debug: inline value-at-cursor in the status bar while PAUSED — moving the cursor over an identifier showsname = value (type)without any explicit command.debug:=in Visual mode evaluates the selection via DAP and shows the result in the status bar.debug: restart via:dbg restartorShift+F5— tears down the running session and relaunches with the previous:dbgcmdline.
Changed
windows: ported the entire Win32/Direct2D frontend from C/C++ to Odin.windows/*.odin(package editor_native_odin) now imports thecore/packages directly and is compiled statically intoeditor.exe— nolibeditor.dllis linked — matching the Linux and macOS frontends; the C-ABI /api.hround-trip is gone from the platform layer. All ~20 C/C++ units became Odin: the WinMain bootstrap, the HWNDWndProc, the Direct2D/DirectWrite render loop, the seven subprocess clients (LSP, DAP, Flutter run, Flutter VM, chat, chat-oneshot, search/grep), theactions/pane_treedispatch, and clipboard/completion/busy/icon/file-io/git-diff/path-utils. Includes hand-written Direct2D + DirectWrite COM-vtable bindings (d2d.odin/dwrite.odin) and a WinHTTP-WebSocket binding for the Dart VM service.clang-clis no longer used to build the frontend (only the Lua dependency and the perm-helper), and the app now links as a GUI binary (-subsystem:windows) so no console window appears. The source layout was flattened to the platform-dir root (windows/*.odin, likelinux/andmacos/).build:make windowsis now a singleodin build windowsstep (no C compilation, nolibeditor.dll).make installon Windows ships onlyeditor.exe+editor-perm-helper.exe— core is statically linked, so no library is installed — mirroringinstall-mac/install-linux.
Fixed
debug: preserve source-pane focus on PAUSED and on output auto-pop soF10/F11work without first clicking back into the code.buffer: clampcursor.scroll_rowwhen the buffer shrinks so empty/short buffers still render correctly.files: plug pending-map + key-string leak in_walker_procrace-loss branch.api: heap-allocate results-pane builder output so thefree()in frontends routes through libc and doesn't abort on arena pointers.macos: read files viaread(2)instead ofmmapto avoidSIGBUSon concurrent writes.build: Windowsmake installinstalled toC:\.local\bininstead of%USERPROFILE%\.local\bin— the genericINSTALL_PREFIX ?= $(HOME)/.localresolved to/.local(empty$(HOME)) and overrode the Windows-specific fallback; the generic default is now Linux/macOS-only.build: silence the harmlesspkg-config/uname"is not recognized" errors when runningmakeon Windows by guarding the Linux-only$(shell …)probes behind the non-Windows branch.
---
0.0.18
Fixed
completion:Tabafter:e src/now showsfoo.odininstead ofsrc/foo.odinin the picker.completion: split on first space (not last) in classify so:e foo bar<Tab>completesfoo baras one filename.completion: descend into a just-accepted directory on the nextTabwithout requiring a manual re-press.completion: cap_match_files/files_in_dirat 1000 entries to boundTabcycles in huge directories.completion: fix per-Tableak in theset!mirror path.completion: fix half-initialised heap record on panic mid-build.editor: fix use-after-free on pane close by wiringon_editor_destroyedhook for chat and LSP.files: pin file-tree cache to heap allocator to prevent dangling slice headers under a per-pane rope pool.
Performance
completion: cache the last directory listing acrossTabrebuilds sosrc/<Tab>…<Backspace><Tab>walkssrc/once.completion: pre-size match result arrays tocap=32to avoid early-growth reallocs during bulk filter passes.buffer/rope: replace ad-hoc right-spine merge with AVL-balanced_jointo keep tree depth O(log n) under adversarial insert patterns.
---
0.0.17
Fixed
macos: git-diff gutter stripe now reads colour fromtheme.gitdiff_*so:color/:themeround-trips reach the gutter.tag-jump-back: pass column toeditor_goto_line_colso jump-back restores the cursor's original column (Linux).chat: loopwritewithEINTRretry on hook fds so partial writes can't truncate the decision JSON (Linux).chat: cap hook request-buffer growth at 4 MiB so it can't outrun the outer payload limit (Linux).flutter_vm: move DNS + connect + WS handshake off the UI thread so a slow VM service can't freeze the editor (Linux).flutter: add 10 spoll()deadline tospawn_and_readso a hung child can't freeze the UI (Linux).perm_helper: free request and close socket on all early-return paths to stop transient-error leaks (Linux).
Performance
macos: skip 95size(withAttributes:)calls inrefreshFontIfNeededwhen family + size match the last computed pair.macos: scan UTF-8 bytes indrawSearchMatchesso per-matchpixelXskips two O(line)utf8.distancewalks.api: sort diagnostics by severity ineditor_set_diagnosticsso the macOS renderer drops its per-frame per-line sort.draw: cache line and collapse 3 walks to 1 in the extra-cursor renderer (Linux).shell_proc: drop at leastLOG_CAP/2on log overflow so head-trimmemmovecost amortises to O(1) per byte (Linux).
---
0.0.16
Internal
build: deriveAPPIMAGE_ARCHfromuname -msomake releasepicks the matching linuxdeploy/appimagetool variant on aarch64 hosts (Linux).build: prependLD_LIBRARY_PATH=AppDir/usr/libto the linuxdeploy invocation so it can resolvelibeditor.sofrom the AppDir (Linux).
0.0.15
Security
chat: harden hook socket / named-pipe paths against path squatting and leaks (Linux, macOS, Windows).chat: writeclaude --settingsJSON to a per-session0600temp file instead of passing it inline via argv (Linux, macOS, Windows).
Fixed
main: stop the file-watcher timer before shutdown to avoid a use-after-free.mouse: fix cursor drift on HiDPI by re-measuring char widths against the scaled Pango layout (Linux).mouse: use exact floatchar_heightfor row mapping to stop drag drift (Windows, macOS).draw: tab labels now usepane_tree_tab_focused_editorinstead of mutating the active tab (Linux, Windows).draw: move autocomplete label/detail frees to a dedicated cleanup loop (fixes leak).actions: fix leaks inaction_splitandaction_dbg_test_startcleanup paths.flutter_proc: threadAppStatethrough and remove file-static singletons (Linux, Windows).backup: cap swap-file basename to fit the FS 255-byte component limit.atomic_write: useReplaceFileWon Windows so durable writes tolerate open readers; suffix the temp name with the thread id to avoid collisions.chat(Windows): fix read path and#defineplacement inchat_proc.c.
Performance
draw: collapse the O(n²) per-glyph layout reset in the list-mode renderer to a single walk (Linux).wrap: O(N) wrapped-line render viavisual_row_advance.syntax: cache per-line block-comment entry state onEditor.git_diff: movegit showonto a reader thread to unblock the UI.
Internal
build: enable-Werroron Linux; silencewarn_unused_resultonly on best-effortwrite/readcalls.actions: addWITH_OWNED_CSTRmacro for scoped FFI string frees.