Skip to content

Conversation

@chittolinag
Copy link
Contributor

Before:

Screenshot 2026-01-12 at 17 48 37

After:

Screenshot 2026-01-12 at 17 48 57

@linear
Copy link

linear bot commented Jan 12, 2026

Copy link

@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: 46e58dbb9d

ℹ️ 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".

Comment on lines 1161 to +1165
const originX = currentLine.width;
// Use first-line effective indent (accounts for hanging) on first line, body indent otherwise
const effectiveIndent = lines.length === 0 ? indentLeft + rawFirstLineOffset : indentLeft;
const absCurrentX = currentLine.width + effectiveIndent;
const { target, nextIndex, stop } = getNextTabStopPx(absCurrentX, tabStops, tabStopCursor);
const { target, nextIndex, stop } = getNextTabStopPx(currentLine.width, tabStops, tabStopCursor);
tabStopCursor = nextIndex;
const maxAbsWidth = currentLine.maxWidth + effectiveIndent;
const clampedTarget = Math.min(target, maxAbsWidth);
const tabAdvance = Math.max(0, clampedTarget - absCurrentX);
const clampedTarget = Math.min(target, currentLine.maxWidth);
const tabAdvance = Math.max(0, clampedTarget - currentLine.width);

Choose a reason for hiding this comment

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

P2 Badge Account for first-line indent when resolving tab stops

Tab advancement now uses currentLine.width directly, but currentLine.width is measured from the first-line text start (which includes firstLine - hanging), while buildTabStopsPx only shifts by indentLeft. On paragraphs with a non‑zero first-line or hanging indent, this means the first line’s tab positions are effectively offset by the first-line indent: the tab stop chosen is too far right (and can skip a nearer stop), so tab leaders and aligned text shift by the first-line offset. This is a regression from the prior effectiveIndent path that added rawFirstLineOffset for line 0; you’ll see it on first lines that include tabs.

Useful? React with 👍 / 👎.

Copy link
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants