sample.js 589 B

1234567891011121314
  1. var originalModel = monaco.editor.createModel("This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text", "text/plain");
  2. var modifiedModel = monaco.editor.createModel("just some text\nabcz\nzzzzefgh\nSome more text\nThis line is removed on the left.", "text/plain");
  3. var diffEditor = monaco.editor.createDiffEditor(document.getElementById("container"), {
  4. // You can optionally disable the resizing
  5. enableSplitViewResizing: false,
  6. // Render the diff inline
  7. renderSideBySide: false
  8. });
  9. diffEditor.setModel({
  10. original: originalModel,
  11. modified: modifiedModel
  12. });