Repository navigation
fix(markdown): widen within cell on empty code lines in offsetAtIndexed and add linear equivalence tests - #73
Merged
Conversation
…ed and add linear equivalence tests
32 of 35 tasks
This was referenced Nov 29, 2026
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 empty-code-line hit-test regression caught during upstream review on vivaui#489:
components/markdown_index.go(offsetAtIndexed):checkRowsNearY) and within table rows by increasing vertical distance, pruning only whenminDy * 1_000_000 > bestScore.pi < best) and cross-cell same-line gap interpolation (prevPlainPiece), makingoffsetAtIndexedbit-for-bit equivalent to the pre-index linear scan on every(x, y), including blank lines inside code blocks.AllocatedBytesdoc comment to describe what the method reports without host-product framing.components/markdown_index_test.go:TestMarkdownIndexMatchesLinearReferenceOnGridcomparingOffsetAt(dense(x, y)grid) andCaretAt(every byte offset0..TextLen()) against linear reference implementations onParse-built documents (empty code lines, horizontal rules, tables with empty/wrapped cells, nested quotes, lists, UTF-8) and programmaticLabeleddocuments.TestMarkdownEmptyCodeLinesStayInCodeBlockdirect regression test.blockSpans/cellSpansfromTestMarkdownBuilderLabeledAndOpaqueLinks.cmd/viva/templates/:markdown_index.go.txt, plustree.go.txtfrom feat(tree): add full-width RowBackground wash for continuous subtree tinting #72 soTestGeneratedRecipesAreCurrentstays green).Verification
gofmt&go vet ./...go test ./markdown/... ./components/... ./tools/docs/... -count=1go test ./cmd/viva -run 'TestListCoversEveryReferenceComponent|TestGeneratedRecipesAreCurrent|TestInstalledRecipesMatchReferenceSource' -count=1BenchmarkMarkdownViewClippedPaintSteady:1580 ns/op, 0 B/op, 0 allocs/opGOOS=windows GOARCH=amd64/arm64 go build ./...andGOOS=js GOARCH=wasm go build ./markdown/... ./components/...