Skip to content

[diffs/edit] add folding support#999

Open
ije wants to merge 4 commits into
mainfrom
ije/folding
Open

[diffs/edit] add folding support#999
ije wants to merge 4 commits into
mainfrom
ije/folding

Conversation

@ije

@ije ije commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator
Screenshot 2026-07-17 at 01 21 41
  • Can disable by add folding: false in the editor option
  • Folding is restricted to File, never FileDiff.
  • Support nested indentation ranges, edit remapping, navigation reveal, and virtualized geometry
  • Chevron controls sit between gutter/content, reveal on gutter-zone hover, strengthen on direct hover, and support keyboard focus.

@ije
ije requested review from amadeus, mdo and necolas July 16, 2026 17:24
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-docs-diffs Ready Ready Preview Jul 22, 2026 2:20am
pierre-docs-diffshub Ready Ready Preview Jul 22, 2026 2:20am
pierre-docs-trees Ready Ready Preview Jul 22, 2026 2:20am
pierrejs-diff-demo Ready Ready Preview Jul 22, 2026 2:20am

Request Review

@blacksmith-sh

This comment has been minimized.

@ije

ije commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc8ba464f0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

}
return {
startingLine,
totalLines: finalLine - startingLine + 1,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid sending folded bodies through render windows

When a viewport contains both the folded header and the first visible line after a large collapsed body (for example folding lines 1–19990), startingLine can be the header while finalLine is after the fold, so this returns a render window spanning the entire hidden body. FileRenderer.renderFile forwards startingLine/totalLines into windowed plain rendering before it skips foldRanges, which means large folded regions are still sliced/joined/tokenized even though only a few visible rows are needed; please avoid passing hidden spans to the renderer or make that path skip folded bodies.

Useful? React with 👍 / 👎.

Base automatically changed from beta-1.3 to main July 21, 2026 21:25
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