This commit is contained in:
Fabian Jakobs 2012-04-11 19:10:06 +02:00
commit 101644923e
7 changed files with 31 additions and 27 deletions

View file

@ -11591,11 +11591,7 @@ var Editor = function(renderer, session) {
this.renderer.updateCursor();
if (!this.$blockScrolling) {
var selection = this.getSelection();
if (selection.isEmpty())
this.renderer.scrollCursorIntoView(selection.getCursor());
else
this.renderer.scrollSelectionIntoView(selection.getSelectionLead(), selection.getSelectionAnchor());
this.renderer.scrollCursorIntoView();
}
// move text input over the cursor
@ -12430,8 +12426,10 @@ var Editor = function(renderer, session) {
return;
this.$tryReplace(range, replacement);
if (range !== null)
if (range !== null) {
this.selection.setSelectionRange(range);
this.renderer.scrollSelectionIntoView(range.start, range.end);
}
};
this.replaceAll = function(replacement, options) {
@ -12504,6 +12502,7 @@ var Editor = function(renderer, session) {
var range = this.$search.find(this.session);
if (range) {
this.session.unfold(range);
this.$blockScrolling += 1;
this.selection.setSelectionRange(range);
this.$blockScrolling -= 1;
@ -12515,6 +12514,8 @@ var Editor = function(renderer, session) {
//@todo scroll X
//if (!this.isRowFullyVisible(cursor.row))
//this.scrollToLine(cursor.row, true);
this.renderer.scrollSelectionIntoView(range.start, range.end);
}
};

View file

@ -11,7 +11,7 @@
Ace
version 0.2.0
commit 4e28a1d31f8c6d5bc6b44aed291ee4bd0c73661f
commit 1d0bc19e3e6744a818e30024176cda1d8c7bdc3d
-->

File diff suppressed because one or more lines are too long

View file

@ -2701,11 +2701,7 @@ var Editor = function(renderer, session) {
this.renderer.updateCursor();
if (!this.$blockScrolling) {
var selection = this.getSelection();
if (selection.isEmpty())
this.renderer.scrollCursorIntoView(selection.getCursor());
else
this.renderer.scrollSelectionIntoView(selection.getSelectionLead(), selection.getSelectionAnchor());
this.renderer.scrollCursorIntoView();
}
// move text input over the cursor
@ -3540,8 +3536,10 @@ var Editor = function(renderer, session) {
return;
this.$tryReplace(range, replacement);
if (range !== null)
if (range !== null) {
this.selection.setSelectionRange(range);
this.renderer.scrollSelectionIntoView(range.start, range.end);
}
};
this.replaceAll = function(replacement, options) {
@ -3614,6 +3612,7 @@ var Editor = function(renderer, session) {
var range = this.$search.find(this.session);
if (range) {
this.session.unfold(range);
this.$blockScrolling += 1;
this.selection.setSelectionRange(range);
this.$blockScrolling -= 1;
@ -3625,6 +3624,8 @@ var Editor = function(renderer, session) {
//@todo scroll X
//if (!this.isRowFullyVisible(cursor.row))
//this.scrollToLine(cursor.row, true);
this.renderer.scrollSelectionIntoView(range.start, range.end);
}
};

View file

@ -2701,11 +2701,7 @@ var Editor = function(renderer, session) {
this.renderer.updateCursor();
if (!this.$blockScrolling) {
var selection = this.getSelection();
if (selection.isEmpty())
this.renderer.scrollCursorIntoView(selection.getCursor());
else
this.renderer.scrollSelectionIntoView(selection.getSelectionLead(), selection.getSelectionAnchor());
this.renderer.scrollCursorIntoView();
}
// move text input over the cursor
@ -3540,8 +3536,10 @@ var Editor = function(renderer, session) {
return;
this.$tryReplace(range, replacement);
if (range !== null)
if (range !== null) {
this.selection.setSelectionRange(range);
this.renderer.scrollSelectionIntoView(range.start, range.end);
}
};
this.replaceAll = function(replacement, options) {
@ -3614,6 +3612,7 @@ var Editor = function(renderer, session) {
var range = this.$search.find(this.session);
if (range) {
this.session.unfold(range);
this.$blockScrolling += 1;
this.selection.setSelectionRange(range);
this.$blockScrolling -= 1;
@ -3625,6 +3624,8 @@ var Editor = function(renderer, session) {
//@todo scroll X
//if (!this.isRowFullyVisible(cursor.row))
//this.scrollToLine(cursor.row, true);
this.renderer.scrollSelectionIntoView(range.start, range.end);
}
};

File diff suppressed because one or more lines are too long

View file

@ -3268,11 +3268,7 @@ var Editor = function(renderer, session) {
this.renderer.updateCursor();
if (!this.$blockScrolling) {
var selection = this.getSelection();
if (selection.isEmpty())
this.renderer.scrollCursorIntoView(selection.getCursor());
else
this.renderer.scrollSelectionIntoView(selection.getSelectionLead(), selection.getSelectionAnchor());
this.renderer.scrollCursorIntoView();
}
// move text input over the cursor
@ -4107,8 +4103,10 @@ var Editor = function(renderer, session) {
return;
this.$tryReplace(range, replacement);
if (range !== null)
if (range !== null) {
this.selection.setSelectionRange(range);
this.renderer.scrollSelectionIntoView(range.start, range.end);
}
};
this.replaceAll = function(replacement, options) {
@ -4181,6 +4179,7 @@ var Editor = function(renderer, session) {
var range = this.$search.find(this.session);
if (range) {
this.session.unfold(range);
this.$blockScrolling += 1;
this.selection.setSelectionRange(range);
this.$blockScrolling -= 1;
@ -4192,6 +4191,8 @@ var Editor = function(renderer, session) {
//@todo scroll X
//if (!this.isRowFullyVisible(cursor.row))
//this.scrollToLine(cursor.row, true);
this.renderer.scrollSelectionIntoView(range.start, range.end);
}
};