Skip to content

Conversation

colin-grant-work
Copy link
Contributor

What it does

Fixes #15105
See also microsoft/vscode#217386 (comment)

Adds code to ensure that the wordWrapOverride2 setting is explicitly cleared when a diff editor is large enough for side-by-side rendering.

How to test

  1. Set the wordWrap preference to true and open a diff editor.
  2. Any lines that need to wrap should wrap on both sides.
  3. Resize the editor horizontally so that it converts to inline diff rendering. (By default, at 900 pixels)
  4. It should convert smoothly to inline mode.
  5. Resize it so that it is large enough for side by side rendering.
  6. Word wrap should work on both sides of the editor again.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Mar 11, 2025
@JonasHelming JonasHelming requested a review from sdirix March 11, 2025 07:55
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Works for me!

Note that there is a related minor issue which I found: When a diff editor is open and we switch the word wrap preference, then the editor reacts accordingly, however the diff markers are then gone afterwards.

If it makes sense you could fix the issue here too or we create a follow up ticket.

@github-project-automation github-project-automation bot moved this from Waiting on reviewers to Needs merge in PR Backlog Mar 12, 2025
@colin-grant-work
Copy link
Contributor Author

When a diff editor is open and we switch the word wrap preference, then the editor reacts accordingly, however the diff markers are then gone afterwards.

It doesn't appear to have to do with toggling the word wrap preference, but with hiding the editor. If you use Alt + Z to toggle the preference, or put the preference view in a different tab bar and then open the diff editor and then use the preference view to change the preference, the editor reacts correctly, and if you hide the editor in any way and then show it again without doing anything else, the diff markers are gone. I suspect that this is has to do with @tsmaeder's recent changes to set and unset the model when an editor is hidden, so I'll create a follow up ticket.

@colin-grant-work colin-grant-work merged commit b4cd470 into master Mar 12, 2025
10 of 11 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Mar 12, 2025
@github-actions github-actions bot added this to the 1.60.0 milestone Mar 12, 2025
@colin-grant-work colin-grant-work deleted the bugfix/no-wrap-left branch June 5, 2025 19:18
laemmleint pushed a commit to mvtecsoftware/theia that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Theia AI] Diff editor line wrapping
2 participants