Improves speed significantly

This commit is contained in:
Dan Kaplun 2014-05-18 05:04:48 -05:00
parent fe2f89074c
commit 593ffa2834
2 changed files with 6 additions and 7 deletions

View File

@ -1,5 +1,4 @@
var _ = require('lazy.js');
var lodash = require('lodash');
var blessed = require('blessed');
var clipboard = require('copy-paste').noConflict();
var Undo = require('undo.js');
@ -728,7 +727,7 @@ Editor.prototype._renderableLineEnding = function (lineEnding) {
, this.options.style.whiteSpace);
};
Editor._nonprintableRegExp = /[\x00-\x1f]|\x7f/g;
Editor.prototype._setContent = lodash.throttle(function () {
Editor.prototype.render = function () {
var self = this;
var scroll = self.scroll();
@ -802,11 +801,6 @@ Editor.prototype._setContent = lodash.throttle(function () {
})
.join('\n'));
self.screen.render();
}, 33);
Editor.prototype.render = function () {
var self = this;
self._setContent();
return blessed.Box.prototype.render.apply(self, arguments);
};

View File

@ -1,4 +1,5 @@
var _ = require('lazy.js');
var lodash = require('lodash');
var blessed = require('blessed');
var path = require('path');
var Promise = require('bluebird');
@ -142,4 +143,8 @@ Slap.prototype._initHandlers = function () {
return self;
};
Slap.prototype.render = lodash.throttle(function () {
return blessed.Screen.prototype.render.apply(this, arguments);
}, 33);
module.exports = Slap;