* Build new version of ace
This commit is contained in:
parent
7f5db3f6b4
commit
491250b68a
7 changed files with 135 additions and 43 deletions
File diff suppressed because one or more lines are too long
|
|
@ -2982,6 +2982,14 @@ var Editor = function(renderer, session) {
|
|||
this.getHighlightSelectedWord = function() {
|
||||
return this.$highlightSelectedWord;
|
||||
};
|
||||
|
||||
this.setAnimatedScroll = function(shouldAnimate){
|
||||
this.renderer.setAnimatedScroll(shouldAnimate);
|
||||
}
|
||||
|
||||
this.getAnimatedScroll = function(){
|
||||
this.rendered.getAnimatedScroll();
|
||||
}
|
||||
|
||||
this.setShowInvisibles = function(showInvisibles) {
|
||||
if (this.getShowInvisibles() == showInvisibles)
|
||||
|
|
@ -11918,6 +11926,8 @@ var VirtualRenderer = function(container, theme) {
|
|||
// Indicates whether the horizontal scrollbar is visible
|
||||
this.$horizScroll = true;
|
||||
this.$horizScrollAlwaysVisible = true;
|
||||
|
||||
this.$animatedScroll = false;
|
||||
|
||||
this.scrollBar = new ScrollBar(container);
|
||||
this.scrollBar.addEventListener("scroll", function(e) {
|
||||
|
|
@ -12089,6 +12099,14 @@ var VirtualRenderer = function(container, theme) {
|
|||
var limit = Math.floor(availableWidth / this.characterWidth);
|
||||
return this.session.adjustWrapLimit(limit);
|
||||
};
|
||||
|
||||
this.setAnimatedScroll = function(shouldAnimate){
|
||||
this.$animatedScroll = shouldAnimate;
|
||||
}
|
||||
|
||||
this.getAnimatedscroll = function(){
|
||||
return this.$animatedScroll
|
||||
}
|
||||
|
||||
this.setShowInvisibles = function(showInvisibles) {
|
||||
if (this.$textLayer.setShowInvisibles(showInvisibles))
|
||||
|
|
@ -12516,7 +12534,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
|
||||
//@todo I would like to make this animation a setting. How?
|
||||
|
||||
var STEPS = 15;
|
||||
var STEPS = 10;
|
||||
function calcSteps(fromValue, toValue){
|
||||
var i = 0,
|
||||
l = STEPS,
|
||||
|
|
@ -12539,16 +12557,21 @@ var VirtualRenderer = function(container, theme) {
|
|||
var offset = pos.top;
|
||||
if (center)
|
||||
offset -= this.$size.scrollerHeight / 2;
|
||||
|
||||
var i = 0, _self = this,
|
||||
steps = calcSteps(this.scrollTop, offset);// console.dir(steps);
|
||||
clearInterval(_self.$timer);
|
||||
this.$timer = setInterval(function(){
|
||||
_self.session.setScrollTop(steps[i]);
|
||||
|
||||
if (++i == STEPS + 1)
|
||||
clearInterval(_self.$timer);
|
||||
}, 10);
|
||||
if (this.$animatedScroll) {
|
||||
var i = 0, _self = this,
|
||||
steps = calcSteps(this.scrollTop, offset);
|
||||
clearInterval(_self.$timer);
|
||||
this.$timer = setInterval(function(){
|
||||
_self.session.setScrollTop(steps[i]);
|
||||
|
||||
if (++i == STEPS + 1)
|
||||
clearInterval(_self.$timer);
|
||||
}, 10);
|
||||
}
|
||||
else {
|
||||
this.session.setScrollTop(offset);
|
||||
}
|
||||
};
|
||||
|
||||
this.scrollToY = function(scrollTop) {
|
||||
|
|
|
|||
|
|
@ -2982,6 +2982,14 @@ var Editor = function(renderer, session) {
|
|||
this.getHighlightSelectedWord = function() {
|
||||
return this.$highlightSelectedWord;
|
||||
};
|
||||
|
||||
this.setAnimatedScroll = function(shouldAnimate){
|
||||
this.renderer.setAnimatedScroll(shouldAnimate);
|
||||
}
|
||||
|
||||
this.getAnimatedScroll = function(){
|
||||
this.rendered.getAnimatedScroll();
|
||||
}
|
||||
|
||||
this.setShowInvisibles = function(showInvisibles) {
|
||||
if (this.getShowInvisibles() == showInvisibles)
|
||||
|
|
@ -11918,6 +11926,8 @@ var VirtualRenderer = function(container, theme) {
|
|||
// Indicates whether the horizontal scrollbar is visible
|
||||
this.$horizScroll = true;
|
||||
this.$horizScrollAlwaysVisible = true;
|
||||
|
||||
this.$animatedScroll = false;
|
||||
|
||||
this.scrollBar = new ScrollBar(container);
|
||||
this.scrollBar.addEventListener("scroll", function(e) {
|
||||
|
|
@ -12089,6 +12099,14 @@ var VirtualRenderer = function(container, theme) {
|
|||
var limit = Math.floor(availableWidth / this.characterWidth);
|
||||
return this.session.adjustWrapLimit(limit);
|
||||
};
|
||||
|
||||
this.setAnimatedScroll = function(shouldAnimate){
|
||||
this.$animatedScroll = shouldAnimate;
|
||||
}
|
||||
|
||||
this.getAnimatedscroll = function(){
|
||||
return this.$animatedScroll
|
||||
}
|
||||
|
||||
this.setShowInvisibles = function(showInvisibles) {
|
||||
if (this.$textLayer.setShowInvisibles(showInvisibles))
|
||||
|
|
@ -12516,7 +12534,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
|
||||
//@todo I would like to make this animation a setting. How?
|
||||
|
||||
var STEPS = 15;
|
||||
var STEPS = 10;
|
||||
function calcSteps(fromValue, toValue){
|
||||
var i = 0,
|
||||
l = STEPS,
|
||||
|
|
@ -12539,16 +12557,21 @@ var VirtualRenderer = function(container, theme) {
|
|||
var offset = pos.top;
|
||||
if (center)
|
||||
offset -= this.$size.scrollerHeight / 2;
|
||||
|
||||
var i = 0, _self = this,
|
||||
steps = calcSteps(this.scrollTop, offset);// console.dir(steps);
|
||||
clearInterval(_self.$timer);
|
||||
this.$timer = setInterval(function(){
|
||||
_self.session.setScrollTop(steps[i]);
|
||||
|
||||
if (++i == STEPS + 1)
|
||||
clearInterval(_self.$timer);
|
||||
}, 10);
|
||||
if (this.$animatedScroll) {
|
||||
var i = 0, _self = this,
|
||||
steps = calcSteps(this.scrollTop, offset);
|
||||
clearInterval(_self.$timer);
|
||||
this.$timer = setInterval(function(){
|
||||
_self.session.setScrollTop(steps[i]);
|
||||
|
||||
if (++i == STEPS + 1)
|
||||
clearInterval(_self.$timer);
|
||||
}, 10);
|
||||
}
|
||||
else {
|
||||
this.session.setScrollTop(offset);
|
||||
}
|
||||
};
|
||||
|
||||
this.scrollToY = function(scrollTop) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue