Skip to content

fix: use lineStartCols instead of missing lineStarts property#97

Merged
hyldmo merged 1 commit intomainfrom
hyldmo/fix-lineinfo-crash
Mar 27, 2026
Merged

fix: use lineStartCols instead of missing lineStarts property#97
hyldmo merged 1 commit intomainfrom
hyldmo/fix-lineinfo-crash

Conversation

@hyldmo
Copy link
Copy Markdown
Owner

@hyldmo hyldmo commented Mar 27, 2026

Summary

  • The ghostty-opentui code accesses lineInfo.lineStarts, but @opentui/core's FFI returns lineStartCols — the lineStarts property doesn't exist on the returned LineInfo object
  • Previous fix (fix: guard lineInfo getter against undefined logicalLineInfo #96) guarded against lineInfo being null/undefined, but the actual crash was lineInfo.lineStarts being undefined
  • Updated patch to use lineStartCols with fallback to lineStarts for compatibility, and added ?. on textBufferView in the getter

Test plan

  • All 614 tests pass
  • Typecheck passes
  • Lint passes
  • Bundle builds successfully with correct output

🤖 Generated with Claude Code

The ghostty-opentui code accesses lineInfo.lineStarts, but @opentui/core's
FFI actually returns lineStartCols. The previous fix guarded against lineInfo
being null, but the real crash was lineInfo.lineStarts being undefined because
the property doesn't exist on the returned LineInfo object.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@hyldmo hyldmo merged commit 7a816d9 into main Mar 27, 2026
2 checks passed
@hyldmo hyldmo deleted the hyldmo/fix-lineinfo-crash branch March 27, 2026 15:07
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.10.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant