microsoft / microsoft/monaco-editor
[Bug] DiffEditor: Toggling `renderSideBySide` breaks `wordWrap` unrecoverably
Open
@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?
- Not 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
- Paste the above into playground
- Hit "run"
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.