Skip to content

feat(diff): add public isHighlighting getter to DiffRenderable#795

Open
remorses wants to merge 2 commits intoanomalyco:mainfrom
remorses:add-diff-is-highlighting
Open

feat(diff): add public isHighlighting getter to DiffRenderable#795
remorses wants to merge 2 commits intoanomalyco:mainfrom
remorses:add-diff-is-highlighting

Conversation

@remorses
Copy link
Contributor

@remorses remorses commented Mar 8, 2026

Adds a public isHighlighting getter to DiffRenderable that returns true when tree-sitter syntax highlighting is in progress on either side of the diff.

This enables consumers like test renderers and batch HTML generators to wait for highlighting deterministically — check diffRenderable.isHighlighting in a loop instead of polling requestRender with arbitrary timeouts.

The getter delegates to CodeRenderable.isHighlighting on both left and right code renderables, which is already tracked internally by _waitingForHighlight + handleLineInfoChange.

Exposes whether tree-sitter syntax highlighting is currently in progress
on either side of the diff. This lets consumers (like test renderers or
batch HTML generators) wait for highlighting to complete deterministically
instead of polling with arbitrary timeouts.

The getter checks isHighlighting on both left and right CodeRenderable
instances, returning true if either is still processing.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 8, 2026

@opentui/core

npm i https://pkg.pr.new/@opentui/core@51ec555

@opentui/react

npm i https://pkg.pr.new/@opentui/react@51ec555

@opentui/solid

npm i https://pkg.pr.new/@opentui/solid@51ec555

@opentui/core-darwin-arm64

npm i https://pkg.pr.new/@opentui/core-darwin-arm64@51ec555

@opentui/core-darwin-x64

npm i https://pkg.pr.new/@opentui/core-darwin-x64@51ec555

@opentui/core-linux-arm64

npm i https://pkg.pr.new/@opentui/core-linux-arm64@51ec555

@opentui/core-linux-x64

npm i https://pkg.pr.new/@opentui/core-linux-x64@51ec555

@opentui/core-win32-arm64

npm i https://pkg.pr.new/@opentui/core-win32-arm64@51ec555

@opentui/core-win32-x64

npm i https://pkg.pr.new/@opentui/core-win32-x64@51ec555

commit: 51ec555

@remorses remorses marked this pull request as ready for review March 8, 2026 22:43
@remorses remorses requested review from kommander and msmps as code owners March 8, 2026 22:43
Copilot AI review requested due to automatic review settings March 8, 2026 22:43
@remorses remorses requested review from Hona and simonklee as code owners March 8, 2026 22:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a public isHighlighting accessor to DiffRenderable so external consumers can determine when tree-sitter highlighting is still running and wait deterministically.

Changes:

  • Introduces DiffRenderable.isHighlighting, delegating to the underlying left/right CodeRenderable.isHighlighting state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants