From 8901c29bd5b18458eb164fe3ae2ae15f24d71aa6 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 31 Mar 2015 05:50:28 -0700 Subject: [PATCH] minor style change. --- lib/widget.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/widget.js b/lib/widget.js index 91ff97e..fea98b2 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -179,7 +179,7 @@ Node.prototype.emitDescendants = function() { var args = Array.prototype.slice(arguments) , iter; - if (typeof args[args.length-1] === 'function') { + if (typeof args[args.length - 1] === 'function') { iter = args.pop(); } @@ -193,7 +193,7 @@ Node.prototype.emitAncestors = function() { var args = Array.prototype.slice(arguments) , iter; - if (typeof args[args.length-1] === 'function') { + if (typeof args[args.length - 1] === 'function') { iter = args.pop(); } @@ -1175,7 +1175,7 @@ Screen.prototype.draw = function(start, end) { } } - if (out[out.length-1] === ';') out = out.slice(0, -1); + if (out[out.length - 1] === ';') out = out.slice(0, -1); out += 'm'; } @@ -1445,7 +1445,7 @@ Screen.prototype.codeAttr = function(code) { } } - if (out[out.length-1] === ';') out = out.slice(0, -1); + if (out[out.length - 1] === ';') out = out.slice(0, -1); return '\x1b[' + out + 'm'; }; @@ -1489,7 +1489,7 @@ Screen.prototype.focusNext = function() { Screen.prototype.focusPush = function(el) { if (!el) return; - var old = this.history[this.history.length-1]; + var old = this.history[this.history.length - 1]; if (this.history.length === 10) { this.history.shift(); } @@ -1500,7 +1500,7 @@ Screen.prototype.focusPush = function(el) { Screen.prototype.focusPop = function() { var old = this.history.pop(); if (this.history.length) { - this._focus(this.history[this.history.length-1], old); + this._focus(this.history[this.history.length - 1], old); } return old; }; @@ -1565,7 +1565,7 @@ Screen.prototype._focus = function(self, old) { }; Screen.prototype.__defineGetter__('focused', function() { - return this.history[this.history.length-1]; + return this.history[this.history.length - 1]; }); Screen.prototype.__defineSetter__('focused', function(el) { @@ -1662,7 +1662,7 @@ Screen.prototype.spawn = function(file, args, options) { }; Screen.prototype.exec = function(file, args, options, callback) { - var callback = arguments[arguments.length-1] + var callback = arguments[arguments.length - 1] , ps = this.spawn(file, args, options); ps.on('error', function(err) { @@ -2377,12 +2377,12 @@ Element.prototype._parseTags = function(text) { if (attr == null) { out += cap[0]; } else { - // if (param !== state[state.length-1]) { + // if (param !== state[state.length - 1]) { // throw new Error('Misnested tags.'); // } state.pop(); if (state.length) { - out += program._attr(state[state.length-1]); + out += program._attr(state[state.length - 1]); } else { out += attr; } @@ -2574,7 +2574,7 @@ main: // If only an escape code got cut off, at it to `part`. if (/^(?:\x1b[\[\d;]*m)+$/.test(line)) { - out[out.length-1] += line; + out[out.length - 1] += line; continue main; } } @@ -3778,7 +3778,7 @@ Element.prototype.render = function() { // If we're on the first cell and we find a newline and the last cell // of the last line was not a newline, let's just treat this like the // newline was already "counted". - if (x === xi && y !== yi && content[ci-2] !== '\n') { + if (x === xi && y !== yi && content[ci - 2] !== '\n') { x--; continue; } @@ -3971,7 +3971,7 @@ Element.prototype.insertLine = function(i, line) { if (i >= this._clines.ftor.length) { real = this._clines.ftor[this._clines.ftor.length - 1]; - real = real[real.length-1] + 1; + real = real[real.length - 1] + 1; } else { real = this._clines.ftor[i][0]; } @@ -5316,7 +5316,7 @@ Textarea.prototype._updateCursor = function(get) { var lpos = get ? this.lpos : this._getCoords(); if (!lpos) return; - var last = this._clines[this._clines.length-1] + var last = this._clines[this._clines.length - 1] , program = this.screen.program , line , cx @@ -5326,8 +5326,8 @@ Textarea.prototype._updateCursor = function(get) { // and the last cline appears to always be empty from the // _typeScroll `+ '\n'` thing. // Maybe not necessary anymore? - if (last === '' && this.value[this.value.length-1] !== '\n') { - last = this._clines[this._clines.length-2] || ''; + if (last === '' && this.value[this.value.length - 1] !== '\n') { + last = this._clines[this._clines.length - 2] || ''; } line = Math.min(