Repository navigation
fix: ten pre-release review findings for 0.10.0 - #27
Merged
Merged
Conversation
…es in one pass $\sqrt[\sqrt[...x$ recursed once per index with no depth check and re-scanned the remainder at each level, aborting the process on a deep enough formula. A linear pre-scan now shows any formula nested deeper than 32 levels as its source, every recursive entry (seq, command, environment) checks the cap itself, and the \sqrt index is rendered in place.
Both comrak extensions paired carets and double bars in ordinary prose: 'Compute 2^10 and 3^5' rendered as 2^(10 and 3)5, and '(a||b) or (c||d)' hid 'b) or (c'. Neither is GitHub markdown, so both are off and such text renders verbatim as in v0.9.0. <sup>/<sub> HTML still gives scripts.
Any document whose first line was { and that had a "key": line was
stripped as JSON frontmatter, so a file that is a JSON object printed
nothing. JSON is now recognised only with --frontmatter and only when
markdown follows the object; then it gets the metadata box. Without the
flag a leading JSON object is document text, as in v0.9.0. YAML/TOML are
unchanged.
close_script collapsed everything between the tags into one span with the first span's style and wrapped it in _(...)/^(...), so a <sub> caption lost its links. The Unicode script mapping now applies only to a single plain-text run whose every character has a script form (^(x)/_(x) in ASCII mode); anything else is left exactly as it was, with no wrapper.
Any value starting with [ and ending with ] was read as a flow list and lost its outer brackets: 'link: [text](url) and [more]' showed as 'text](url) and [more'. A value is a list now only when its opening [ is closed by the final ] (quotes respected); otherwise it is shown verbatim.
Fence detection only looked at indent 0-3 of the raw line, so a block in a blockquote (> ```py) or an indented list item was neither reopened nor had its orphan closer dropped: --line-range 7 printed the code as quote prose, 7: opened an empty code box swallowing the rest. Blockquote markers and list indentation are now stripped when detecting fences, the prefix is remembered, and reopened/closing fences are emitted with it. A block reopened inside a list item is drawn at the top level, well-formed.
Focusing the TOC and then shrinking the window to 40 columns or fewer hid the sidebar but left it focused: keys moved an invisible cursor and the status bar kept the TOC hints. One sidebar_shown() rule now decides the draw, the layout width and the focus action, and every frame drops focus (and any filter) when the sidebar is not shown.
When composite-state or subgraph frames could not be drawn, the fallback note listed every member, including the unlabelled [*] start/end states: "Running: , A, B, ". Members with an empty label are now skipped.
std's Command only appends .exe on Windows, so EDITOR="code --wait" (VS Code, Cursor and VSCodium install code.cmd and the like) failed with "program not found". A bare editor name is now resolved against PATH and PATHEXT (default .COM;.EXE;.BAT;.CMD) by a pure, unit-tested function and the full path is spawned; explicit paths and names with an extension are left alone. std quotes .bat/.cmd arguments itself and refuses ones it cannot escape; that error is shown in the status bar. The Windows behaviour itself is not verified on Windows.
rebuild_tab, the --watch branch and reload_after_edit each rebuilt a tab and each had to remember the sidebar's visibility, its interaction state and the current-heading selection. They now share reload_tab with an explicit Anchor (KeepOffset for re-layout and --watch, Heading after e). The accidental differences are unified: rebuild_tab clamped the offset to len - 1, now len - viewport like every scroll and the other two paths. viewport_heading reuses TocState::current_heading, the rule update_selection uses. Toggling or focusing the TOC re-lays out at a new width and now refreshes search matches, as a resize already did.
500 ms was within noise of a busy CI runner (the frac case took 500.6 ms on ubuntu-latest); the test guards against quadratic behaviour that took minutes, so a 20 s bound still catches it.
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the ten findings from the high-effort code review of
v0.9.0..main, one commit and regression test each.\sqrt[no longer overflows the stack.^superscript^and||spoiler||syntax is turned off: both rewrote ordinary prose (2^10 and 3^5,(a||b) or (c||d)).<sup>/<sub>remain.<sub>/<sup>keep links and styling; only short plain text with script forms becomes Unicode sub/superscript.--frontmatterit gets the metadata box only when markdown follows.--line-rangerepairs fences inside blockquotes and list items..cmd/.batshims throughPATHandPATHEXT.Testing
fmt, clippy and the full suite pass locally, including the pty suite. No snapshots changed. The Windows call site is compiled by this PR's CI only.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UVcvmQrSXd2eyt32g4ko19