Skip to content

mdo/editor#732

Open
mdo wants to merge 202 commits into
mainfrom
mdo/editor
Open

mdo/editor#732
mdo wants to merge 202 commits into
mainfrom
mdo/editor

Conversation

@mdo
Copy link
Copy Markdown
Contributor

@mdo mdo commented May 21, 2026

Based on #601, but can't select a fork as my base branch.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

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

Project Deployment Actions Updated (UTC)
pierre-docs-diffshub Ready Ready Preview May 21, 2026 11:45pm
pierre-docs-trees Ready Ready Preview May 21, 2026 11:45pm
pierrejs-diff-demo Ready Ready Preview May 21, 2026 11:45pm
pierrejs-docs Ready Ready Preview May 21, 2026 11:45pm

Request Review

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 21, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​pierre/​icons@​0.5.0 ⏵ 0.6.07710078 +196 +1100
Updated@​pierre/​icons@​0.5.0 ⏵ 0.6.1100 +24100100 +24100 +5100

View full report

Copy link
Copy Markdown

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

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: 113426c889

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +800 to +804
for (let lineIndex = 0; lineIndex < lineCount; lineIndex++) {
const isAtHunkBoundary = currentLine % hunkLineCount === 0;

const lineHeight = this.getLineHeight(lineIndex, false);
if (isAtHunkBoundary) {
hunkOffsets.push(absoluteLineTop - (fileTop + headerRegion));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Iterate from checkpoint line when scanning virtualized hunks

When checkpoint is non-zero (common after scrolling deep into large/wrapped files), this loop restarts lineIndex at 0 while currentLine already starts at checkpoint.lineIndex, and it also appends hunk offsets with push instead of indexing by the actual hunk number. That desynchronizes measured line heights and hunkOffsets, so bufferBefore/bufferAfter are computed from the wrong hunks and the virtualized window can jump or anchor to incorrect positions.

Useful? React with 👍 / 👎.

const { disableFileHeader = false, collapsed = false } = this.options;
const lines = this.getOrCreateLineCache(this.file);
const lastLineIndex = getLastVisibleLineIndex(lines);
const lastLineIndex = this.getOrCreateLineOffSets(this.file).at(-1) ?? -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 Clamp line indices using line count, not line-start offset

getOrCreateLineOffSets(...).at(-1) returns the character offset of the last line start, not the last valid line index, so this clamp can allow synthetic line indexes far beyond the document length (especially for long first lines or trailing-newline files). That can produce invalid line anchors/positions in getLinePosition and getNumericScrollAnchor, breaking scroll restoration and target-line positioning for small files.

Useful? React with 👍 / 👎.

- Add web app manifest and support files
- Add additional styles to support web app mode
- Improve search design
- Add custom header for an app-like style
- Replace custom icons with @pierre/icons
- Add splash screen while it loads
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