Skip to content

Fix bug with diff editor not wrapping red lines.#292094

Open
Andrew199617 wants to merge 2 commits intomicrosoft:mainfrom
Andrew199617:andrewv-256329
Open

Fix bug with diff editor not wrapping red lines.#292094
Andrew199617 wants to merge 2 commits intomicrosoft:mainfrom
Andrew199617:andrewv-256329

Conversation

@Andrew199617
Copy link
Copy Markdown

@Andrew199617 Andrew199617 commented Jan 31, 2026

Im creating an extension that opens diffs for p4 files. I noticed that red lines in diff editor dont get wrapped in a lot of scenarios. #256329 is an example of a place where the word wrap would not work. For me its easy to reproduce by just opening a fresh vscode with no extensions and then opening a diff on any file. If you have wrap on the modified side, the original side still wont follow that.

Here is what it looks like before my changes. Take note of line 160 on the left side. It is not wrapped when it should be. I have wrapping enabled on the modified side. Both sides are meant to have the same wrapping style.
image

Here is an example of what it looks like when its working because we are making sure result.wordWrapOverride2 is also set.
image

Some more details for repro.

  • Open a git diff for a file.
  • Make sure that wrapping is on.
  • Make the file smaller by extending the primary sidebar until it changes from side by side view to unified view.
  • Clicking Ctrl+B to close the primary sidebar now try to find lines on left side that should be wrapping.
  • Easy way to know if wrapping is enabled or not for the left side is to look and see if horizontal scrollbar shows.

Copilot AI review requested due to automatic review settings January 31, 2026 22:38
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

This PR fixes a bug where the original (left/red) side of the diff editor was not respecting word wrap settings in side-by-side view. The fix ensures that wordWrapOverride2 is set in addition to wordWrapOverride1, maintaining consistency with how word wrap is disabled in inline mode.

Changes:

  • Added wordWrapOverride2 assignment in the left-hand side editor configuration to properly enable word wrap for the original side of the diff editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants