[PR #734] [CLOSED] text-buffer-view: lineInfo byte-start tests #745

Closed
opened 2026-03-02 23:47:55 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/734
Author: @simonklee
Created: 2/24/2026
Status: Closed

Base: mainHead: layout-scan-offsets


📝 Commits (10+)

  • 80713a4 text-buffer-view: lineInfo byte-start tests
  • 32a7298 utf8: add canonical layout scanner
  • bde5a63 make tests compile
  • 5f078c1 text-buffer-segment: add bounded windowed layout cache
  • b3daaa8 text-buffer-view: produce byte offsets in wrap
  • c890eb2 fix(tests): align text wrapping expectations
  • dc73c06 view: add byte windows to virtual chunks
  • 2caa9b0 edit-buffer: migrate word motion to layout spans
  • b895151 core: clarify byte/column line-info names
  • 5de682a utf8: cleanup adapter APIs and types

📊 Changes

35 files changed (+3391 additions, -2214 deletions)

View changed files

📝 packages/core/src/renderables/Code.test.ts (+3 -3)
📝 packages/core/src/renderables/Text.test.ts (+3 -3)
📝 packages/core/src/renderables/TextBufferRenderable.ts (+2 -2)
📝 packages/core/src/renderables/__snapshots__/Diff.test.ts.snap (+6 -6)
📝 packages/core/src/renderables/__snapshots__/Text.test.ts.snap (+9 -9)
📝 packages/core/src/renderables/__snapshots__/TextTable.test.ts.snap (+4 -4)
📝 packages/core/src/renderables/__tests__/LineNumberRenderable.test.ts (+3 -3)
📝 packages/core/src/renderables/__tests__/Textarea.scroll.test.ts (+1 -1)
📝 packages/core/src/renderables/__tests__/__snapshots__/Textarea.rendering.test.ts.snap (+6 -6)
📝 packages/core/src/text-buffer-view.test.ts (+252 -51)
📝 packages/core/src/types.ts (+3 -3)
📝 packages/core/src/zig-structs.ts (+5 -5)
📝 packages/core/src/zig.ts (+32 -12)
📝 packages/core/src/zig/bench/text-chunk-graphemes_bench.zig (+78 -23)
📝 packages/core/src/zig/bench/utf8_bench.zig (+127 -6)
📝 packages/core/src/zig/buffer.zig (+88 -86)
📝 packages/core/src/zig/edit-buffer.zig (+60 -37)
📝 packages/core/src/zig/editor-view.zig (+3 -3)
📝 packages/core/src/zig/lib.zig (+51 -70)
📝 packages/core/src/zig/tests/editor-view_test.zig (+2 -2)

...and 15 more files

📄 Description

Pin UTF-8 boundary, monotonicity, and determinism invariants for lineStarts across CJK, emoji, tab, and newline inputs. A fixed-seed corpus test catches regressions from future
wrap-offset changes.

These tests are expected to fail for now.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/734 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 2/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `layout-scan-offsets` --- ### 📝 Commits (10+) - [`80713a4`](https://github.com/anomalyco/opentui/commit/80713a47a402cca68989a94c786048744d12372a) text-buffer-view: lineInfo byte-start tests - [`32a7298`](https://github.com/anomalyco/opentui/commit/32a7298daa3e181ebb1799949f42cd853e36bcdb) utf8: add canonical layout scanner - [`bde5a63`](https://github.com/anomalyco/opentui/commit/bde5a63f34c785884db366d579f3accdc0164e2c) make tests compile - [`5f078c1`](https://github.com/anomalyco/opentui/commit/5f078c1c53ffc3ccb19399dd1bf801bb3119aaa6) text-buffer-segment: add bounded windowed layout cache - [`b3daaa8`](https://github.com/anomalyco/opentui/commit/b3daaa8626692563cd709387783b25e9fb59399a) text-buffer-view: produce byte offsets in wrap - [`c890eb2`](https://github.com/anomalyco/opentui/commit/c890eb2c64b02544c0bdc2d1ee05c8cb762e3f11) fix(tests): align text wrapping expectations - [`dc73c06`](https://github.com/anomalyco/opentui/commit/dc73c060ab2c2fe36f995a9627f61a297d95012d) view: add byte windows to virtual chunks - [`2caa9b0`](https://github.com/anomalyco/opentui/commit/2caa9b0c9a3ec683afd76ff4be7032dfe7ff24c7) edit-buffer: migrate word motion to layout spans - [`b895151`](https://github.com/anomalyco/opentui/commit/b8951517eb9e5128a400fab5060bff3625a32f40) core: clarify byte/column line-info names - [`5de682a`](https://github.com/anomalyco/opentui/commit/5de682a2f261830bf92de50df66d449c2324572b) utf8: cleanup adapter APIs and types ### 📊 Changes **35 files changed** (+3391 additions, -2214 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderables/Code.test.ts` (+3 -3) 📝 `packages/core/src/renderables/Text.test.ts` (+3 -3) 📝 `packages/core/src/renderables/TextBufferRenderable.ts` (+2 -2) 📝 `packages/core/src/renderables/__snapshots__/Diff.test.ts.snap` (+6 -6) 📝 `packages/core/src/renderables/__snapshots__/Text.test.ts.snap` (+9 -9) 📝 `packages/core/src/renderables/__snapshots__/TextTable.test.ts.snap` (+4 -4) 📝 `packages/core/src/renderables/__tests__/LineNumberRenderable.test.ts` (+3 -3) 📝 `packages/core/src/renderables/__tests__/Textarea.scroll.test.ts` (+1 -1) 📝 `packages/core/src/renderables/__tests__/__snapshots__/Textarea.rendering.test.ts.snap` (+6 -6) 📝 `packages/core/src/text-buffer-view.test.ts` (+252 -51) 📝 `packages/core/src/types.ts` (+3 -3) 📝 `packages/core/src/zig-structs.ts` (+5 -5) 📝 `packages/core/src/zig.ts` (+32 -12) 📝 `packages/core/src/zig/bench/text-chunk-graphemes_bench.zig` (+78 -23) 📝 `packages/core/src/zig/bench/utf8_bench.zig` (+127 -6) 📝 `packages/core/src/zig/buffer.zig` (+88 -86) 📝 `packages/core/src/zig/edit-buffer.zig` (+60 -37) 📝 `packages/core/src/zig/editor-view.zig` (+3 -3) 📝 `packages/core/src/zig/lib.zig` (+51 -70) 📝 `packages/core/src/zig/tests/editor-view_test.zig` (+2 -2) _...and 15 more files_ </details> ### 📄 Description Pin UTF-8 boundary, monotonicity, and determinism invariants for lineStarts across CJK, emoji, tab, and newline inputs. A fixed-seed corpus test catches regressions from future wrap-offset changes. These tests are expected to fail for now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:55 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#745
No description provided.