package
This commit is contained in:
parent
9fee4b7d96
commit
d6e6a8ce97
47 changed files with 309 additions and 162 deletions
|
|
@ -2646,7 +2646,7 @@ var Editor = function(renderer, session) {
|
|||
this.renderer.updateLines(rows.first, rows.last);
|
||||
};
|
||||
|
||||
this.onCursorChange = function(e) {
|
||||
this.onCursorChange = function() {
|
||||
this.renderer.updateCursor();
|
||||
|
||||
if (!this.$blockScrolling) {
|
||||
|
|
@ -9827,22 +9827,23 @@ function Folding() {
|
|||
var re = new RegExp(token.type.replace(/\..*/, "\\."));
|
||||
do {
|
||||
token = iterator.stepBackward();
|
||||
} while(token && re.test(token.type))
|
||||
} while(token && re.test(token.type));
|
||||
|
||||
iterator.stepForward();
|
||||
range.start.row = iterator.getCurrentTokenRow();
|
||||
range.start.column = iterator.getCurrentTokenColumn() + 2;
|
||||
|
||||
var iterator = new TokenIterator(this, row, column);
|
||||
iterator = new TokenIterator(this, row, column);
|
||||
|
||||
do {
|
||||
token = iterator.stepForward();
|
||||
} while(token && re.test(token.type))
|
||||
} while(token && re.test(token.type));
|
||||
|
||||
token = iterator.stepBackward();
|
||||
|
||||
range.end.row = iterator.getCurrentTokenRow();
|
||||
range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 1;
|
||||
return range
|
||||
return range;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -9862,28 +9863,51 @@ function Folding() {
|
|||
this.addFold("...", range);
|
||||
} catch(e) {}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.$foldStyles = {
|
||||
"manual": 1,
|
||||
"markbegin": 1,
|
||||
"markbeginend": 1
|
||||
};
|
||||
this.$foldStyle = "markbegin";
|
||||
this.setFoldStyle = function(style) {
|
||||
if (!this.$foldStyles[style])
|
||||
throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
|
||||
|
||||
if (this.$foldStyle == style)
|
||||
return;
|
||||
|
||||
this.$foldStyle = style;
|
||||
|
||||
// reset folding
|
||||
var mode = this.$foldMode;
|
||||
this.$setFolding(null);
|
||||
this.$setFolding(mode);
|
||||
};
|
||||
|
||||
// structured folding
|
||||
this.$setFolding = function(foldMode) {
|
||||
|
||||
if (this.$foldMode == foldMode)
|
||||
return;
|
||||
|
||||
this.$foldMode = foldMode;
|
||||
|
||||
this.removeListener('change', this.$updateFoldWidgets);
|
||||
this._emit("changeAnnotation");
|
||||
|
||||
if (!foldMode) {
|
||||
if (!foldMode || this.$foldStyle == "manual") {
|
||||
this.foldWidgets = null;
|
||||
return;
|
||||
}
|
||||
|
||||
this.foldWidgets = [];
|
||||
this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this);
|
||||
this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this);
|
||||
this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle);
|
||||
this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle);
|
||||
|
||||
this.$updateFoldWidgets = this.updateFoldWidgets.bind(this);
|
||||
this.on('change', this.$updateFoldWidgets);
|
||||
|
||||
};
|
||||
|
||||
this.onFoldWidgetClick = function(row, e) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue