Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monaco-diff-editor: View only changed lines in monaco difference editor side by side view

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.enter image description here

like image 633
Harshad Sindhav Avatar asked Oct 27 '25 13:10

Harshad Sindhav


1 Answers

Maybe you are looking for inline version?

https://microsoft.github.io/monaco-editor/playground.html#creating-the-diffeditor-inline-diff-example

key is setting renderSideBySide option to true


var diffEditor = monaco.editor.createDiffEditor(containerEl, {
    // Render the diff inline
    renderSideBySide: false
});
like image 136
pom Avatar answered Oct 29 '25 18:10

pom