| Summary: | CodeEdit: Need an API to create folding annotation. | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | libing wang <libingw> |
| Component: | Docker | Assignee: | libing wang <libingw> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 12.0 | ||
| Target Milestone: | 13.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
libing wang
var editorModel = editorViewer.editor.getModel();
var foldingAnnotations = [];
editorModel.addEventListener("Changed", function(evt) {
// var modelChangedEvent = {
// type: "Changed", //$NON-NLS-0$
// start: eventStart,
// removedCharCount: removedCharCount,
// addedCharCount: addedCharCount,
// removedLineCount: removedLineCount,
// addedLineCount: addedLineCount
// };
var annotationModel = editorViewer.editor.getAnnotationModel();
foldingAnnotations.forEach(function(anno){
annotationModel.removeAnnotation(anno);
});
foldingAnnotations = [];
//window.setTimeout(function(){
var fAnno1 = editorViewer.editor.addFoldingAnnotation(0, 250);
if(fAnno1) {
foldingAnnotations.push(fAnno1);
}
//}, 500);
});
|