Fix issue parsing args in sgr() introduced recently

This commit is contained in:
Bryan Ashby 2016-06-27 23:07:59 -06:00
parent dc8a06331b
commit a3b4568a76
1 changed files with 3 additions and 2 deletions

View File

@ -354,13 +354,14 @@ function sgr() {
let result = []; let result = [];
const args = Array.isArray(arguments[0]) ? arguments[0] : arguments; const args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
args.forEach(arg => { for(let i = 0; i < args.length; ++i) {
const arg = args[i];
if(_.isString(arg) && arg in SGRValues) { if(_.isString(arg) && arg in SGRValues) {
result.push(SGRValues[arg]); result.push(SGRValues[arg]);
} else if(_.isNumber(arg)) { } else if(_.isNumber(arg)) {
result.push(arg); result.push(arg);
} }
}); }
return `${ESC_CSI}${result.join(';')}m`; return `${ESC_CSI}${result.join(';')}m`;
} }