package
This commit is contained in:
parent
328dbc312f
commit
3fcbaa4c7c
7 changed files with 25 additions and 22 deletions
|
|
@ -3525,7 +3525,7 @@ var Editor = function(renderer, session) {
|
||||||
this._dispatchEvent("change", e);
|
this._dispatchEvent("change", e);
|
||||||
|
|
||||||
// update cursor because tab characters can influence the cursor position
|
// update cursor because tab characters can influence the cursor position
|
||||||
this.renderer.updateCursor();
|
this.onCursorChange();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onTokenizerUpdate = function(e) {
|
this.onTokenizerUpdate = function(e) {
|
||||||
|
|
@ -4142,6 +4142,10 @@ var Editor = function(renderer, session) {
|
||||||
return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
|
return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.isRowFullyVisible = function(row) {
|
||||||
|
return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());
|
||||||
|
};
|
||||||
|
|
||||||
this.$getVisibleRowCount = function() {
|
this.$getVisibleRowCount = function() {
|
||||||
return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
|
return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
|
||||||
};
|
};
|
||||||
|
|
@ -4256,10 +4260,8 @@ var Editor = function(renderer, session) {
|
||||||
this.$blockScrolling += 1;
|
this.$blockScrolling += 1;
|
||||||
this.moveCursorTo(lineNumber-1, column || 0);
|
this.moveCursorTo(lineNumber-1, column || 0);
|
||||||
this.$blockScrolling -= 1;
|
this.$blockScrolling -= 1;
|
||||||
|
if (!this.isRowFullyVisible(this.getCursorPosition().row))
|
||||||
if (!this.isRowVisible(this.getCursorPosition().row)) {
|
|
||||||
this.scrollToLine(lineNumber, true);
|
this.scrollToLine(lineNumber, true);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.navigateTo = function(row, column) {
|
this.navigateTo = function(row, column) {
|
||||||
|
|
@ -4411,9 +4413,8 @@ var Editor = function(renderer, session) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$find = function(backwards) {
|
this.$find = function(backwards) {
|
||||||
if (!this.selection.isEmpty()) {
|
if (!this.selection.isEmpty())
|
||||||
this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())});
|
this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())});
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof backwards != "undefined")
|
if (typeof backwards != "undefined")
|
||||||
this.$search.set({backwards: backwards});
|
this.$search.set({backwards: backwards});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
Ace
|
Ace
|
||||||
version 0.2.0
|
version 0.2.0
|
||||||
commit e910138acddb2226501de83a093297b1b619d8d4
|
commit 328dbc312f308810c2532ad27552df5b490ba9ab
|
||||||
|
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
|
||||||
|
|
@ -2670,7 +2670,7 @@ var Editor = function(renderer, session) {
|
||||||
this._dispatchEvent("change", e);
|
this._dispatchEvent("change", e);
|
||||||
|
|
||||||
// update cursor because tab characters can influence the cursor position
|
// update cursor because tab characters can influence the cursor position
|
||||||
this.renderer.updateCursor();
|
this.onCursorChange();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onTokenizerUpdate = function(e) {
|
this.onTokenizerUpdate = function(e) {
|
||||||
|
|
@ -3287,6 +3287,10 @@ var Editor = function(renderer, session) {
|
||||||
return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
|
return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.isRowFullyVisible = function(row) {
|
||||||
|
return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());
|
||||||
|
};
|
||||||
|
|
||||||
this.$getVisibleRowCount = function() {
|
this.$getVisibleRowCount = function() {
|
||||||
return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
|
return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
|
||||||
};
|
};
|
||||||
|
|
@ -3401,10 +3405,8 @@ var Editor = function(renderer, session) {
|
||||||
this.$blockScrolling += 1;
|
this.$blockScrolling += 1;
|
||||||
this.moveCursorTo(lineNumber-1, column || 0);
|
this.moveCursorTo(lineNumber-1, column || 0);
|
||||||
this.$blockScrolling -= 1;
|
this.$blockScrolling -= 1;
|
||||||
|
if (!this.isRowFullyVisible(this.getCursorPosition().row))
|
||||||
if (!this.isRowVisible(this.getCursorPosition().row)) {
|
|
||||||
this.scrollToLine(lineNumber, true);
|
this.scrollToLine(lineNumber, true);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.navigateTo = function(row, column) {
|
this.navigateTo = function(row, column) {
|
||||||
|
|
@ -3556,9 +3558,8 @@ var Editor = function(renderer, session) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$find = function(backwards) {
|
this.$find = function(backwards) {
|
||||||
if (!this.selection.isEmpty()) {
|
if (!this.selection.isEmpty())
|
||||||
this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())});
|
this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())});
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof backwards != "undefined")
|
if (typeof backwards != "undefined")
|
||||||
this.$search.set({backwards: backwards});
|
this.$search.set({backwards: backwards});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -2632,7 +2632,7 @@ var Editor = function(renderer, session) {
|
||||||
this._dispatchEvent("change", e);
|
this._dispatchEvent("change", e);
|
||||||
|
|
||||||
// update cursor because tab characters can influence the cursor position
|
// update cursor because tab characters can influence the cursor position
|
||||||
this.renderer.updateCursor();
|
this.onCursorChange();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onTokenizerUpdate = function(e) {
|
this.onTokenizerUpdate = function(e) {
|
||||||
|
|
@ -3249,6 +3249,10 @@ var Editor = function(renderer, session) {
|
||||||
return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
|
return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.isRowFullyVisible = function(row) {
|
||||||
|
return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());
|
||||||
|
};
|
||||||
|
|
||||||
this.$getVisibleRowCount = function() {
|
this.$getVisibleRowCount = function() {
|
||||||
return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
|
return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
|
||||||
};
|
};
|
||||||
|
|
@ -3363,10 +3367,8 @@ var Editor = function(renderer, session) {
|
||||||
this.$blockScrolling += 1;
|
this.$blockScrolling += 1;
|
||||||
this.moveCursorTo(lineNumber-1, column || 0);
|
this.moveCursorTo(lineNumber-1, column || 0);
|
||||||
this.$blockScrolling -= 1;
|
this.$blockScrolling -= 1;
|
||||||
|
if (!this.isRowFullyVisible(this.getCursorPosition().row))
|
||||||
if (!this.isRowVisible(this.getCursorPosition().row)) {
|
|
||||||
this.scrollToLine(lineNumber, true);
|
this.scrollToLine(lineNumber, true);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.navigateTo = function(row, column) {
|
this.navigateTo = function(row, column) {
|
||||||
|
|
@ -3518,9 +3520,8 @@ var Editor = function(renderer, session) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$find = function(backwards) {
|
this.$find = function(backwards) {
|
||||||
if (!this.selection.isEmpty()) {
|
if (!this.selection.isEmpty())
|
||||||
this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())});
|
this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())});
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof backwards != "undefined")
|
if (typeof backwards != "undefined")
|
||||||
this.$search.set({backwards: backwards});
|
this.$search.set({backwards: backwards});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue