Skip to content

Add diffEditor.hideOriginalLineNumbers setting to hide original line numbers in inline view - #334531

Open
Fahad Iftikhar (Fahad090NP) wants to merge 5 commits into
microsoft:mainfrom
Fahad090NP:feature/diff-editor-hide-original-line-numbers
Open

Fahad Iftikhar (Fahad090NP) wants to merge 5 commits into
microsoft:mainfrom
Fahad090NP:feature/diff-editor-hide-original-line-numbers

Conversation

@Fahad090NP

Copy link
Copy Markdown

Fixes #329944

Summary

Adds a user-facing setting to toggle the original (before-edit) line numbers in the diff editor's inline view.

The diff editor already had an internal hideOriginalLineNumbers option (used by the Copilot/Agents changes editors and multi-diff inline rendering) that drops the narrow original line-number column in the inline view, making the code sit flush left like GitHub Copilot's inline diff. This change exposes it as a setting and makes hiding the original line numbers the default.

Changes

  • diffEditor.hideOriginalLineNumbers (boolean, default true) — when enabled, the inline diff view does not show the line numbers of the file before changes. Uncheck to show the before/after line numbers as before.
  • The widget-level default is flipped to match, so the behavior is consistent across all diff editor consumers (workbench diff editor, multi-diff editor, etc.).
  • Only affects the inline view; the side-by-side view is unchanged.
  • Re-renders live when the setting is toggled.

Verification

  • tsc --noEmit -p src/tsconfig.json passes
  • eslint passes on the changed files

Restored PR: This replaces #329899, which was closed automatically when my fork was deleted from GitHub. GitHub cannot reopen a PR whose head repository was deleted, so the branch was rebuilt from the original commit (same message and authorship) on top of the current main. Please review this PR in place of #329899.

@Fahad090NP

Copy link
Copy Markdown
Author

Context: this PR replaces #329899, which was closed automatically when my fork was deleted from GitHub. GitHub cannot reopen a PR whose head repository was deleted, so the branch was rebuilt from the original commit (same message and authorship) on top of the current main.

Maintainers: please judge this PR in place of the closed #329899. Thank you!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The shared default changes Monaco’s public behavior without exposing a supported opt-out.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a setting to hide original line numbers in inline diff views.

Changes:

  • Registers diffEditor.hideOriginalLineNumbers, defaulting to true.
  • Updates the internal option documentation and widget default.
File summaries
File Description
editorOptions.ts Documents the new default.
editorConfigurationSchema.ts Registers the setting.
diffEditor.ts Changes the shared widget default.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/editor/common/config/diffEditor.ts Outdated
…Code config

The shared diffEditor widget default stays compatible with standalone
Monaco consumers (hideOriginalLineNumbers: false). The true default is
now applied through VS Code's configuration layer so users get the
expected behavior without breaking monaco.editor.createDiffEditor.
@saitanallensantiago26-beep

Fixes #329944

Summary

Adds a user-facing setting to toggle the original (before-edit) line numbers in the diff editor's inline view.

The diff editor already had an internal hideOriginalLineNumbers option (used by the Copilot/Agents changes editors and multi-diff inline rendering) that drops the narrow original line-number column in the inline view, making the code sit flush left like GitHub Copilot's inline diff. This change exposes it as a setting and makes hiding the original line numbers the default.

Changes

  • diffEditor.hideOriginalLineNumbers (boolean, default true) — when enabled, the inline diff view does not show the line numbers of the file before changes. Uncheck to show the before/after line numbers as before.
  • The widget-level default is flipped to match, so the behavior is consistent across all diff editor consumers (workbench diff editor, multi-diff editor, etc.).
  • Only affects the inline view; the side-by-side view is unchanged.
  • Re-renders live when the setting is toggled.

Verification

  • tsc --noEmit -p src/tsconfig.json passes
  • eslint passes on the changed files

Restored PR: This replaces #329899, which was closed automatically when my fork was deleted from GitHub. GitHub cannot reopen a PR whose head repository was deleted, so the branch was rebuilt from the original commit (same message and authorship) on top of the current main. Please review this PR in place of #329899.

This branch has not been deployed

No deployments
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.

Setting to control original line numbers shown in the inline diff view

4 participants