microsoft / microsoft/monaco-editor

[Bug] DiffEditor: Toggling `renderSideBySide` breaks `wordWrap` unrecoverably

Open
#3,346 5 comments 0 reactions 1 assignee View on GitHub

@alexdima is already working on this.

Since Apr 17, 2023.

bug diff-editor
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop

(I don't know, haven't used either and I don't know how to get a diff editor)

Reproducible in the monaco editor playground?
Monaco Editor Playground Code
var originalModel = monaco.editor.createModel(
	'This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text\nThis line is hella loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong',
	'text/plain'
);
var modifiedModel = monaco.editor.createModel(
	'just some text\nabcz\nzzzzefgh\nSome more text.\nThis line is removed on the left.',
	'text/plain'
);

var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'), {
	wordWrap: 'on'
});

diffEditor.setModel({
	original: originalModel,
	modified: modifiedModel
});

setTimeout(() => {
    diffEditor.updateOptions({
        renderSideBySide: false,
        wordWrap: 'on'
    });

    setTimeout(() => {
        diffEditor.updateOptions({
            renderSideBySide: true,
            wordWrap: 'on'
        });
    }, 1000);
}, 1000);
Reproduction Steps
  1. Paste the above into playground
  2. Hit "run"
  3. Wait a few seconds
Actual (Problematic) Behavior

After toggling renderSideBySide wordWrap unrecoverably becomes broken (disabled) and cannot be enabled again.

Expected Behavior

wordWrap should work at all times

Additional Context

No response

Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.36.1#XQAAAAK8AwAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw4rxF7Xzf4wOPUi0R0mEihWCV4AhRfW6uUIEjM3Y7DbLylIr1uDEh-48Vup1lSNeKklvi0xT6EWWHG4Pn4qydwOKAaH844crdRB4cWQDJKZ6Cv2smc5zTiruEj6CZzg3yjQ5CxHbDQ5dtdfQ2OyiOr_aOYEOgIpFlmrCu0Xkv5ayd93zRlI9OSf9RGbwAkROL0e6Vm9y7wIIjqHpMbH6mqnrYPGinsIZPZJ56HOjvlglRdTn537prNNx0HCPsyZnhzHD8bsRKRBQQtzu8UZ4mWsfWjmy6_W6nUrUnER_--xgBLT3f_aQ_Z31gwGrP_aIYLrx900M3Eecz1DzYKJL0mROQj44NrvOtKiHD7DDXRuuDSTEZVUOl7peWbAeu8jWBRFOjqS3ti0c_kThiYwprFsGGM_0qRjHz8Xc1yW0hLxG46zWjbJ9tZKYTONH_MMaj0-VG4-8NyoqV_od2NA

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.