minor changes and cleanup.
This commit is contained in:
parent
b5c7aed3ad
commit
17c4cb1e2a
|
@ -292,6 +292,8 @@ function Screen(options) {
|
|||
right: this.right = this.rright = 0,
|
||||
top: this.top = this.rtop = 0,
|
||||
bottom: this.bottom = this.rbottom = 0
|
||||
//get height() { return self.height; },
|
||||
//get width() { return self.width; }
|
||||
};
|
||||
|
||||
this.ileft = 0;
|
||||
|
@ -684,8 +686,7 @@ Screen.prototype.deleteLine = function(n, y, top, bottom) {
|
|||
Screen.prototype.insertLineNC = function(n, y, top, bottom) {
|
||||
if (!this.tput
|
||||
|| !this.tput.strings.change_scroll_region
|
||||
|| !this.tput.strings.delete_line
|
||||
|| !this.tput.strings.insert_line) return;
|
||||
|| !this.tput.strings.delete_line) return;
|
||||
|
||||
this._buf += this.tput.csr(top, bottom);
|
||||
this._buf += this.tput.cup(top, 0);
|
||||
|
@ -708,8 +709,7 @@ Screen.prototype.insertLineNC = function(n, y, top, bottom) {
|
|||
Screen.prototype.deleteLineNC = function(n, y, top, bottom) {
|
||||
if (!this.tput
|
||||
|| !this.tput.strings.change_scroll_region
|
||||
|| !this.tput.strings.delete_line
|
||||
|| !this.tput.strings.insert_line) return;
|
||||
|| !this.tput.strings.delete_line) return;
|
||||
|
||||
this._buf += this.tput.csr(top, bottom);
|
||||
this._buf += this.tput.cup(bottom, 0);
|
||||
|
@ -1070,7 +1070,7 @@ Screen.prototype.draw = function(start, end) {
|
|||
ch = this.tput.acscr[ch];
|
||||
} else {
|
||||
ch = this.tput.smacs()
|
||||
+ this.tput.acscr[ch]
|
||||
+ this.tput.acscr[ch];
|
||||
acs = true;
|
||||
}
|
||||
} else if (acs) {
|
||||
|
@ -1605,7 +1605,8 @@ Screen.prototype.readEditor = function(options, callback) {
|
|||
return fs.writeFile(file, options.value, callback);
|
||||
}
|
||||
|
||||
return writeFile(function() {
|
||||
return writeFile(function(err) {
|
||||
if (err) return callback(err);
|
||||
return self.exec(editor, args, opt, function(err, success) {
|
||||
if (err) return callback(err);
|
||||
return fs.readFile(file, 'utf8', function(err, data) {
|
||||
|
@ -2358,12 +2359,11 @@ Element.prototype._getWidth = function(get) {
|
|||
width = parent.width - (this.position.right || 0) - left;
|
||||
if (this.screen.autoPadding) {
|
||||
if ((this.position.left != null || this.position.right == null)
|
||||
&& this.position.left !== 'center') {
|
||||
width -= (this.position.left != null || this.position.right == null)
|
||||
&& this.position.left !== 'center' ? this.parent.ileft : 0;
|
||||
&& this.position.left !== 'center') {
|
||||
width -= this.parent.ileft;
|
||||
}
|
||||
if (this.position.right != null) {
|
||||
width -= this.position.right != null ? this.parent.iright : 0;
|
||||
width -= this.parent.iright;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue