Reputation: 181
In monaco code diff editor, complete content is shown in original and modified section for side by side view. Can anyone please help in a way to show only changed lines in code difference editor without unchanged contents in the diff editor.
Upvotes: 4
Views: 8079
Reputation: 38046
There's hideUnchangedRegions
option:
const diffEditor = monaco.editor.createDiffEditor(
document.getElementById("container"),
{
hideUnchangedRegions: {
enabled: true
},
}
);
Upvotes: 1
Reputation: 483
Maybe you are looking for inline version?
key is setting renderSideBySide
option to true
var diffEditor = monaco.editor.createDiffEditor(containerEl, {
// Render the diff inline
renderSideBySide: false
});
Upvotes: 3