fix NO_PADDING detection.

This commit is contained in:
Christopher Jeffrey 2015-08-06 00:26:23 -07:00
parent 0547509481
commit 216aaf1f48
2 changed files with 7 additions and 1 deletions

View File

@ -280,7 +280,7 @@ Program.prototype.setupTput = function() {
return;
}
if (options.padding) {
if (tput.padding) {
self.put[key] = function() {
return tput._print(tput[key].apply(tput, arguments), write);
};

View File

@ -702,6 +702,12 @@ Tput.prototype.inject = function(info) {
this.features = info.features;
Object.keys(info.features).forEach(function(key) {
if (key === 'padding') {
if (!info.features.padding && self.options.padding !== true) {
self.padding = false;
}
return;
}
self[key] = info.features[key];
});
};