update packaged ace

This commit is contained in:
Fabian Jakobs 2011-05-01 09:41:40 +00:00
commit 8cafb75db0
2 changed files with 45 additions and 30 deletions

View file

@ -5475,6 +5475,7 @@ var Editor =function(renderer, session) {
this.session.removeEventListener("changeTabSize", this.$onChangeTabSize); this.session.removeEventListener("changeTabSize", this.$onChangeTabSize);
this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit); this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit);
this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode); this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode);
this.session.removeEventListener("onChangeFold", this.$onChangeFold);
this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker); this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker);
this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker); this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker);
this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint); this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint);
@ -5509,6 +5510,9 @@ var Editor =function(renderer, session) {
this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); this.$onChangeWrapMode = this.onChangeWrapMode.bind(this);
session.addEventListener("changeWrapMode", this.$onChangeWrapMode); session.addEventListener("changeWrapMode", this.$onChangeWrapMode);
this.$onChangeFold = this.onChangeFold.bind(this);
session.addEventListener("changeFold", this.$onChangeFold);
this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this);
this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker); this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker);
@ -5668,8 +5672,14 @@ var Editor =function(renderer, session) {
session.$highlightLineMarker = null; session.$highlightLineMarker = null;
if (this.getHighlightActiveLine() && (this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { if (this.getHighlightActiveLine() && (this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) {
var cursor = this.getCursorPosition(); var cursor = this.getCursorPosition(),
var range = new Range(cursor.row, 0, cursor.row+1, 0); foldLine = this.session.getFoldLine(cursor.row);
var range;
if (foldLine) {
range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0);
} else {
range = new Range(cursor.row, 0, cursor.row+1, 0);
}
session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "line"); session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "line");
} }
}; };
@ -5722,6 +5732,11 @@ var Editor =function(renderer, session) {
this.renderer.onResize(true); this.renderer.onResize(true);
}; };
this.onChangeFold = function() {
// TODO: This might be too much updating. Okay for now.
this.renderer.updateFull();
};
this.getCopyText = function() { this.getCopyText = function() {
if (!this.selection.isEmpty()) { if (!this.selection.isEmpty()) {
return this.session.getTextRange(this.getSelectionRange()); return this.session.getTextRange(this.getSelectionRange());
@ -5770,8 +5785,8 @@ var Editor =function(renderer, session) {
var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());
var end = session.insert(cursor, text); var end = session.insert(cursor, text);
var lineState = session.getState(cursor.row); var lineState = session.getState(cursor.row);
// TODO disabled multiline auto indent // TODO disabled multiline auto indent
// possibly doing the indent before inserting the text // possibly doing the indent before inserting the text
// if (cursor.row !== end.row) { // if (cursor.row !== end.row) {

File diff suppressed because one or more lines are too long