sample.js 597 B

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