mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Merge pull request #3775 from PmcFizz/main
use createDecorationsCollection replace deltaDecorations
This commit is contained in:
commit
7374280f4e
3 changed files with 30 additions and 39 deletions
|
|
@ -15,19 +15,16 @@ var editor = monaco.editor.create(document.getElementById("container"), {
|
||||||
language: "javascript",
|
language: "javascript",
|
||||||
});
|
});
|
||||||
|
|
||||||
var decorations = editor.deltaDecorations(
|
var decorations = editor.createDecorationsCollection([
|
||||||
[],
|
{
|
||||||
[
|
range: new monaco.Range(3, 1, 5, 1),
|
||||||
{
|
options: {
|
||||||
range: new monaco.Range(3, 1, 5, 1),
|
isWholeLine: true,
|
||||||
options: {
|
linesDecorationsClassName: "myLineDecoration",
|
||||||
isWholeLine: true,
|
|
||||||
linesDecorationsClassName: "myLineDecoration",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
range: new monaco.Range(7, 1, 7, 24),
|
{
|
||||||
options: { inlineClassName: "myInlineDecoration" },
|
range: new monaco.Range(7, 1, 7, 24),
|
||||||
},
|
options: { inlineClassName: "myInlineDecoration" },
|
||||||
]
|
},
|
||||||
);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -17,19 +17,16 @@ var editor = monaco.editor.create(document.getElementById("container"), {
|
||||||
contextmenu: false,
|
contextmenu: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
var decorations = editor.deltaDecorations(
|
var decorations = editor.createDecorationsCollection([
|
||||||
[],
|
{
|
||||||
[
|
range: new monaco.Range(3, 1, 3, 1),
|
||||||
{
|
options: {
|
||||||
range: new monaco.Range(3, 1, 3, 1),
|
isWholeLine: true,
|
||||||
options: {
|
className: "myContentClass",
|
||||||
isWholeLine: true,
|
glyphMarginClassName: "myGlyphMarginClass",
|
||||||
className: "myContentClass",
|
|
||||||
glyphMarginClassName: "myGlyphMarginClass",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
]
|
},
|
||||||
);
|
]);
|
||||||
|
|
||||||
// Add a zone to make hit testing more interesting
|
// Add a zone to make hit testing more interesting
|
||||||
var viewZoneId = null;
|
var viewZoneId = null;
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,15 @@ var editor = monaco.editor.create(document.getElementById("container"), {
|
||||||
glyphMargin: true,
|
glyphMargin: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
var decorations = editor.deltaDecorations(
|
var decorations = editor.createDecorationsCollection([
|
||||||
[],
|
{
|
||||||
[
|
range: new monaco.Range(3, 1, 3, 1),
|
||||||
{
|
options: {
|
||||||
range: new monaco.Range(3, 1, 3, 1),
|
isWholeLine: true,
|
||||||
options: {
|
className: "myContentClass",
|
||||||
isWholeLine: true,
|
glyphMarginClassName: "myGlyphMarginClass",
|
||||||
className: "myContentClass",
|
|
||||||
glyphMarginClassName: "myGlyphMarginClass",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
]
|
},
|
||||||
);
|
]);
|
||||||
|
|
||||||
// You can now use `decorations` to change or remove the decoration
|
// You can now use `decorations` to change or remove the decoration
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue