microsoft / microsoft/monaco-editor
[Bug] DiffEditor: word wrap stops working on the left side after switching from inline to side-by-side view
Open
@hediet is already working on this.
Since Jun 10, 2026.
- 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
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
const LONG_LINE = `"message": "This is a deliberately long line that should word-wrap at the viewport edge when wordWrap is on, but will not wrap on the original (left) side after switching from inline to side-by-side view due to a Monaco bug"`;
const originalModel = monaco.editor.createModel(
`{\n ${LONG_LINE},\n "status": "ok"\n}`,
'json'
);
const modifiedModel = monaco.editor.createModel(
`{\n ${LONG_LINE},\n "status": "error"\n}`,
'json'
);
const diffEditor = monaco.editor.createDiffEditor(
document.getElementById("container"),
{
renderSideBySide: false,
wordWrap: 'on',
diffWordWrap: 'on',
automaticLayout: true,
}
);
diffEditor.setModel({ original: originalModel, modified: modifiedModel });
document.getElementById("switch-btn").addEventListener("click", () => {
diffEditor.updateOptions({ renderSideBySide: true });
document.getElementById("note").textContent =
"Side-by-side view: left (original) does NOT wrap ❌ — right (modified) wraps ✓";
});
<button id="switch-btn" style="margin: 8px 0; padding: 6px 14px; cursor: pointer">
Switch to side-by-side view
</button>
<p id="note" style="margin: 4px 0 8px; font-size: 12px; color: #555">
Currently: inline view. Click the button — word wrap will break on the left.
</p>
<div id="container" style="height: 80%"></div>
Reproduction Steps
- Go to the Playground
- Click on
Switch to side-by-side viewbutton
Actual (Problematic) Behavior
Observe that the left editor doesn't have word wrapping on:
Expected Behavior
Left editor should have word wrapping
Additional Context
No response
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.