Merge branch 'master' of github.com:ajaxorg/ace
This commit is contained in:
commit
31179780ab
7 changed files with 29 additions and 18 deletions
|
|
@ -6145,7 +6145,13 @@ var Editor =function(renderer, session) {
|
||||||
if (this.selection.isEmpty())
|
if (this.selection.isEmpty())
|
||||||
this.selection.selectLineEnd();
|
this.selection.selectLineEnd();
|
||||||
|
|
||||||
this.session.remove(this.getSelectionRange());
|
var range = this.getSelectionRange();
|
||||||
|
if (range.start.column == range.end.column && range.start.row == range.end.row) {
|
||||||
|
range.end.column = 0;
|
||||||
|
range.end.row++;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.session.remove(range);
|
||||||
this.clearSelection();
|
this.clearSelection();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -24,7 +24,7 @@ Features
|
||||||
Take Ace for a spin!
|
Take Ace for a spin!
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Check out the Ace live [demo](http://ajaxorg.github.com/ace/build/editor.html) or get a [Cloud9 IDE account](http://run.cloud9ide.com) to experience Ace while editing one of your own GitHub projects.
|
Check out the Ace live [demo](http://ajaxorg.github.com/ace/) or get a [Cloud9 IDE account](http://run.cloud9ide.com) to experience Ace while editing one of your own GitHub projects.
|
||||||
|
|
||||||
If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.com/ace/build/textarea/editor.html).
|
If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.com/ace/build/textarea/editor.html).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6160,7 +6160,13 @@ var Editor =function(renderer, session) {
|
||||||
if (this.selection.isEmpty())
|
if (this.selection.isEmpty())
|
||||||
this.selection.selectLineEnd();
|
this.selection.selectLineEnd();
|
||||||
|
|
||||||
this.session.remove(this.getSelectionRange());
|
var range = this.getSelectionRange();
|
||||||
|
if (range.start.column == range.end.column && range.start.row == range.end.row) {
|
||||||
|
range.end.column = 0;
|
||||||
|
range.end.row++;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.session.remove(range);
|
||||||
this.clearSelection();
|
this.clearSelection();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -12847,7 +12853,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scrollBar = new ScrollBar(container);
|
this.scrollBar = new ScrollBar(container);
|
||||||
this.scrollBar.addEventListener("scroll", this.onScroll.bind(this));
|
this.scrollBar.addEventListener("scroll", this.onScroll.bind(this));
|
||||||
|
|
||||||
this.scrollTop = this.desiredScrollTop = 0;
|
this.scrollTop = 0;
|
||||||
|
|
||||||
this.cursorPos = {
|
this.cursorPos = {
|
||||||
row : 0,
|
row : 0,
|
||||||
|
|
@ -13222,8 +13228,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
||||||
|
|
||||||
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
||||||
this.scrollTop = this.desiredScrollTop =
|
this.scrollTop = Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight));
|
||||||
Math.max(0, Math.min(this.desiredScrollTop, maxHeight - this.$size.scrollerHeight));
|
|
||||||
|
|
||||||
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
||||||
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
||||||
|
|
@ -13369,11 +13374,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var left = pos.left + this.$padding;
|
var left = pos.left + this.$padding;
|
||||||
var top = pos.top;
|
var top = pos.top;
|
||||||
|
|
||||||
if (this.desiredScrollTop > top) {
|
if (this.scrollTop > top) {
|
||||||
this.scrollToY(top);
|
this.scrollToY(top);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.desiredScrollTop + this.$size.scrollerHeight < top + this.lineHeight) {
|
if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) {
|
||||||
this.scrollToY(top + this.lineHeight - this.$size.scrollerHeight);
|
this.scrollToY(top + this.lineHeight - this.$size.scrollerHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -13427,9 +13432,10 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scrollToY = function(scrollTop) {
|
this.scrollToY = function(scrollTop) {
|
||||||
// after calling scrollBar.setScrollTop
|
// after calling scrollBar.setScrollTop
|
||||||
// scrollbar sends us event with same scrollTop. ignore it
|
// scrollbar sends us event with same scrollTop. ignore it
|
||||||
if (this.desiredScrollTop !== scrollTop) {
|
scrollTop = Math.max(0, scrollTop);
|
||||||
|
if (this.scrollTop !== scrollTop) {
|
||||||
this.$loop.schedule(this.CHANGE_SCROLL);
|
this.$loop.schedule(this.CHANGE_SCROLL);
|
||||||
this.desiredScrollTop = scrollTop;
|
this.scrollTop = scrollTop;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -14016,10 +14022,9 @@ var Text = function(parentEl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var style = this.$measureNode.style;
|
var style = this.$measureNode.style;
|
||||||
for (var prop in this.$fontStyles) {
|
var computedStyle = dom.computedStyle(this.element);
|
||||||
var value = dom.computedStyle(this.element, prop);
|
for (var prop in this.$fontStyles)
|
||||||
style[prop] = value;
|
style[prop] = computedStyle[prop];
|
||||||
}
|
|
||||||
|
|
||||||
var size = {
|
var size = {
|
||||||
height: this.$measureNode.offsetHeight,
|
height: this.$measureNode.offsetHeight,
|
||||||
|
|
|
||||||
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