[PR #795] feat(diff): add public isHighlighting getter to DiffRenderable #1569

Open
opened 2026-03-14 09:43:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/795
Author: @remorses
Created: 3/8/2026
Status: 🔄 Open

Base: mainHead: add-diff-is-highlighting


📝 Commits (2)

  • fddb2d1 feat(diff): add public isHighlighting getter to DiffRenderable
  • 13db7b7 Update Diff.ts

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 packages/core/src/renderables/Diff.ts (+6 -0)

📄 Description

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.


🔄 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/795 **Author:** [@remorses](https://github.com/remorses) **Created:** 3/8/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `add-diff-is-highlighting` --- ### 📝 Commits (2) - [`fddb2d1`](https://github.com/anomalyco/opentui/commit/fddb2d1ef505e92d57c85d22292780748b0e0120) feat(diff): add public isHighlighting getter to DiffRenderable - [`13db7b7`](https://github.com/anomalyco/opentui/commit/13db7b7c019b2594ce9e2b886cf1f51f1e42d889) Update Diff.ts ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderables/Diff.ts` (+6 -0) </details> ### 📄 Description 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`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1569
No description provided.