Skip to content

fix: restore word wrap after diff editor inline to split-view transition#314903

Open
heliole wants to merge 3 commits intomicrosoft:mainfrom
heliole:restore-word-wrap
Open

fix: restore word wrap after diff editor inline to split-view transition#314903
heliole wants to merge 3 commits intomicrosoft:mainfrom
heliole:restore-word-wrap

Conversation

@heliole
Copy link
Copy Markdown

@heliole heliole commented May 7, 2026

Fixes #314898

Summary

Fixes diff editor word wrap when resizing from inline to side-by-side mode by clearing the stale wordWrapOverride2 override so diffEditor.wordWrap is honored.

Copilot AI review requested due to automatic review settings May 7, 2026 02:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a diff editor layout transition bug where word wrap could remain disabled after switching from inline to side-by-side mode, by resetting wordWrapOverride2 so diffEditor.wordWrap can take effect again.

Changes:

  • Reset wordWrapOverride2 to 'inherit' when updating sub-editor options so stale inline-mode overrides don’t keep winning.
  • Apply the reset for both original (left) and modified (right) sub-editors during option recomputation.

Comment on lines 148 to 152
} else {
result.unicodeHighlight = this._options.editorOptions.get().unicodeHighlight || {};
result.wordWrapOverride1 = this._options.diffWordWrap.get();
result.wordWrapOverride2 = 'inherit';
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

re-check

@heliole
Copy link
Copy Markdown
Author

heliole commented May 7, 2026

I apologize for the mistake.

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.

Diff editor loses word wrap after inline -> side-by-side transition

3 participants