mirror of
https://github.com/slap-editor/slap.git
synced 2024-09-19 16:57:26 +03:00
Improves speed significantly
This commit is contained in:
parent
fe2f89074c
commit
593ffa2834
@ -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);
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user