diff --git a/node_modules/ace_tree/lib/ace_tree/virtual_renderer.js b/node_modules/ace_tree/lib/ace_tree/virtual_renderer.js index 031237ef..68cab1c1 100644 --- a/node_modules/ace_tree/lib/ace_tree/virtual_renderer.js +++ b/node_modules/ace_tree/lib/ace_tree/virtual_renderer.js @@ -839,31 +839,45 @@ var VirtualRenderer = function(container, cellWidth, cellHeight) { this.animateScrolling = function(fromValue, callback) { var toValue = this.scrollTop; - if (this.$animatedScroll && Math.abs(fromValue - toValue) < 100000) { - var _self = this; - var steps = _self.$calcSteps(fromValue, toValue); - this.$inScrollAnimation = true; - - clearInterval(this.$timer); - - _self.provider.setScrollTop(steps.shift()); - this.$timer = setInterval(function() { - if (steps.length) { - _self.setScrollTop(steps.shift()); - // trick provider to think it's already scrolled to not loose toValue - _self.scrollTop = toValue; - } else if (toValue != null) { - _self.scrollTop = -1; - _self.setScrollTop(toValue); - toValue = null; - } else { - // do this on separate step to not get spurious scroll event from scrollbar - _self.$timer = clearInterval(_self.$timer); - _self.$inScrollAnimation = false; - callback && callback(); - } - }, 10); + if (!this.$animatedScroll) + return; + var _self = this; + + if (fromValue == toValue) + return; + + if (this.$scrollAnimation) { + var oldSteps = this.$scrollAnimation.steps; + if (oldSteps.length) { + fromValue = oldSteps[0]; + if (fromValue == toValue) + return; + } } + + var steps = _self.$calcSteps(fromValue, toValue); + this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps}; + + clearInterval(this.$timer); + + _self.provider.setScrollTop(steps.shift()); + // trick provider to think it's already scrolled to not loose toValue + _self.provider.$scrollTop = toValue; + this.$timer = setInterval(function() { + if (steps.length) { + _self.provider.setScrollTop(steps.shift()); + _self.provider.$scrollTop = toValue; + } else if (toValue != null) { + _self.provider.$scrollTop = -1; + _self.provider.setScrollTop(toValue); + toValue = null; + } else { + // do this on separate step to not get spurious scroll event from scrollbar + _self.$timer = clearInterval(_self.$timer); + _self.$scrollAnimation = null; + callback && callback(); + } + }, 10); }; /** diff --git a/package.json b/package.json index 2ff0ad49..c71d92ee 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "c9.ide.immediate": "#6845a93705", "c9.ide.installer": "#19b25fc787", "c9.ide.mount": "#896ebf836e", - "c9.ide.navigate": "#64156c7f4a", + "c9.ide.navigate": "#7c58c7f3d7", "c9.ide.newresource": "#f1f0624768", "c9.ide.openfiles": "#28a4f5af16", "c9.ide.preview": "#0bd8dd6e8c", diff --git a/plugins/c9.ide.keys/commands.js b/plugins/c9.ide.keys/commands.js index 2f8e7fda..7d6b8a26 100644 --- a/plugins/c9.ide.keys/commands.js +++ b/plugins/c9.ide.keys/commands.js @@ -245,7 +245,7 @@ define(function(require, exports, module) { function setDefault(name, keys) { var command = commands[name]; - + if (!command) return; // If bind key is not yet overridden by a custom one if (plugin.commandManager[name] == command.bindKey[platform]) bindKey(keys[platform], command);