Merge remote-tracking branch 'nightwing/pullreq'
Conflicts: lib/ace/virtual_renderer.js
This commit is contained in:
commit
dd55f74256
3 changed files with 31 additions and 27 deletions
|
|
@ -22,12 +22,6 @@
|
||||||
cursor: text;
|
cursor: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setting pointer-events: auto; on node under the mouse, which changes during scroll,
|
|
||||||
will break mouse wheel scrolling in Safari */
|
|
||||||
.ace_content * {
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ace_composition {
|
.ace_composition {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: #555;
|
background: #555;
|
||||||
|
|
@ -35,12 +29,6 @@
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_gutter .ace_layer {
|
|
||||||
position: relative;
|
|
||||||
min-width: 54px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ace_gutter {
|
.ace_gutter {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
overflow : hidden;
|
overflow : hidden;
|
||||||
|
|
@ -125,6 +113,16 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
|
/* setting pointer-events: auto; on node under the mouse, which changes
|
||||||
|
during scroll, will break mouse wheel scrolling in Safari */
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace_gutter .ace_layer {
|
||||||
|
position: relative;
|
||||||
|
min-width: 40px;
|
||||||
|
text-align: right;
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_text-layer {
|
.ace_text-layer {
|
||||||
|
|
@ -222,7 +220,7 @@
|
||||||
cursor: move;
|
cursor: move;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_folding-enabled .ace_gutter-cell {
|
.ace_folding-enabled > .ace_gutter-cell {
|
||||||
padding-right: 13px;
|
padding-right: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ exports.cssText = ".ace-tm .ace_editor {\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
.ace-tm .ace_fold {\
|
.ace-tm .ace_fold {\
|
||||||
background-color: #0000A2;\
|
background-color: #6B72E6;\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
.ace-tm .ace_text-layer {\
|
.ace-tm .ace_text-layer {\
|
||||||
|
|
|
||||||
|
|
@ -421,21 +421,27 @@ var VirtualRenderer = function(container, theme) {
|
||||||
)
|
)
|
||||||
this.$computeLayerConfig();
|
this.$computeLayerConfig();
|
||||||
|
|
||||||
|
// horizontal scrolling
|
||||||
|
if (changes & this.CHANGE_H_SCROLL)
|
||||||
|
this.scroller.scrollLeft = this.scrollLeft
|
||||||
|
|
||||||
// full
|
// full
|
||||||
if (changes & this.CHANGE_FULL) {
|
if (changes & this.CHANGE_FULL) {
|
||||||
this.$textLayer.checkForSizeChanges();
|
this.$textLayer.checkForSizeChanges();
|
||||||
|
// update scrollbar first to not loose scroll position when gutter calls resize
|
||||||
|
this.$updateScrollBar();
|
||||||
this.$textLayer.update(this.layerConfig);
|
this.$textLayer.update(this.layerConfig);
|
||||||
if (this.showGutter)
|
if (this.showGutter)
|
||||||
this.$gutterLayer.update(this.layerConfig);
|
this.$gutterLayer.update(this.layerConfig);
|
||||||
this.$markerBack.update(this.layerConfig);
|
this.$markerBack.update(this.layerConfig);
|
||||||
this.$markerFront.update(this.layerConfig);
|
this.$markerFront.update(this.layerConfig);
|
||||||
this.$cursorLayer.update(this.layerConfig);
|
this.$cursorLayer.update(this.layerConfig);
|
||||||
this.$updateScrollBar();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// scrolling
|
// scrolling
|
||||||
if (changes & this.CHANGE_SCROLL) {
|
if (changes & this.CHANGE_SCROLL) {
|
||||||
|
this.$updateScrollBar();
|
||||||
if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES)
|
if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES)
|
||||||
this.$textLayer.update(this.layerConfig);
|
this.$textLayer.update(this.layerConfig);
|
||||||
else
|
else
|
||||||
|
|
@ -446,7 +452,6 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.$markerBack.update(this.layerConfig);
|
this.$markerBack.update(this.layerConfig);
|
||||||
this.$markerFront.update(this.layerConfig);
|
this.$markerFront.update(this.layerConfig);
|
||||||
this.$cursorLayer.update(this.layerConfig);
|
this.$cursorLayer.update(this.layerConfig);
|
||||||
this.$updateScrollBar();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -456,10 +461,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.$gutterLayer.update(this.layerConfig);
|
this.$gutterLayer.update(this.layerConfig);
|
||||||
}
|
}
|
||||||
else if (changes & this.CHANGE_LINES) {
|
else if (changes & this.CHANGE_LINES) {
|
||||||
this.$updateLines();
|
if (this.$updateLines()) {
|
||||||
this.$updateScrollBar();
|
this.$updateScrollBar();
|
||||||
if (this.showGutter)
|
if (this.showGutter)
|
||||||
this.$gutterLayer.update(this.layerConfig);
|
this.$gutterLayer.update(this.layerConfig);
|
||||||
|
}
|
||||||
} else if (changes & this.CHANGE_GUTTER) {
|
} else if (changes & this.CHANGE_GUTTER) {
|
||||||
if (this.showGutter)
|
if (this.showGutter)
|
||||||
this.$gutterLayer.update(this.layerConfig);
|
this.$gutterLayer.update(this.layerConfig);
|
||||||
|
|
@ -478,11 +484,6 @@ var VirtualRenderer = function(container, theme) {
|
||||||
|
|
||||||
if (changes & this.CHANGE_SIZE)
|
if (changes & this.CHANGE_SIZE)
|
||||||
this.$updateScrollBar();
|
this.$updateScrollBar();
|
||||||
|
|
||||||
if (changes & this.CHANGE_H_SCROLL) {
|
|
||||||
//this.content.style.left = -this.scrollLeft + "px";
|
|
||||||
this.scroller.scrollLeft = this.scrollLeft
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$computeLayerConfig = function() {
|
this.$computeLayerConfig = function() {
|
||||||
|
|
@ -496,9 +497,13 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - longestLine < 0;
|
var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - longestLine < 0;
|
||||||
var horizScrollChanged = this.$horizScroll !== horizScroll;
|
var horizScrollChanged = this.$horizScroll !== horizScroll;
|
||||||
this.$horizScroll = horizScroll;
|
this.$horizScroll = horizScroll;
|
||||||
if (horizScrollChanged)
|
if (horizScrollChanged) {
|
||||||
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
||||||
|
// when we hide scrollbar scroll event isn't emited
|
||||||
|
// leaving session with wrong scrollLeft value
|
||||||
|
if (!horizScroll)
|
||||||
|
this.session.setScrollLeft(0);
|
||||||
|
}
|
||||||
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
||||||
this.session.setScrollTop(Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight)));
|
this.session.setScrollTop(Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight)));
|
||||||
|
|
||||||
|
|
@ -579,6 +584,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
|
|
||||||
// else update only the changed rows
|
// else update only the changed rows
|
||||||
this.$textLayer.updateLines(layerConfig, firstRow, lastRow);
|
this.$textLayer.updateLines(layerConfig, firstRow, lastRow);
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$getLongestLine = function() {
|
this.$getLongestLine = function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue