microsoft / microsoft/monaco-editor
Add possibility to add view zone inside deleted text zone in inline diff editor
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
first, create diffEditor
this.diffEditor = monaco.editor.createDiffEditor(dom, options);
second, get originalEditor
this.originalEditor = this.diffEditor.originalEditor;
third, addViewZone to originalEditor
this.originalEditor.changeViewZones((changeAccessor) => {
const domNode = doucument.createElement('div');
changeAccessor.addZone({afterLineNumber: 1, domNode});
})
in Chrom, it can work when i use side-by-side

but, when i switch to inline-diff, it can't work

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.
Research direction
Reproduce the issue by creating a diff editor, accessing originalEditor, and calling changeViewZones with a zone after line 1. Compare side-by-side and inline-diff modes, then trace the inline-diff handling for original-editor view zones. Done means the view zone is displayed inside deleted text in inline-diff mode as it is in side-by-side mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100