|
|
@ -188,7 +188,7 @@ Interface.prototype._tabComplete = function () { |
|
|
|
var item = group[idx]; |
|
|
|
self.output.write(item); |
|
|
|
if (col < maxColumns - 1) { |
|
|
|
for (var s = 0; s < width - item.length; s++) { |
|
|
|
for (var s = 0, itemLen = item.length; s < width - itemLen; s++) { |
|
|
|
self.output.write(' '); |
|
|
|
} |
|
|
|
} |
|
|
@ -198,8 +198,8 @@ Interface.prototype._tabComplete = function () { |
|
|
|
self.output.write('\r\n'); |
|
|
|
} |
|
|
|
|
|
|
|
var group = [], c, i; |
|
|
|
for (i = 0; i < completions.length; i++) { |
|
|
|
var group = [], c; |
|
|
|
for (var i = 0, compLen = completions.length; i < compLen; i++) { |
|
|
|
c = completions[i]; |
|
|
|
if (c === "") { |
|
|
|
handleGroup(group); |
|
|
@ -230,7 +230,7 @@ function commonPrefix(strings) { |
|
|
|
var sorted = strings.slice().sort(); |
|
|
|
var min = sorted[0]; |
|
|
|
var max = sorted[sorted.length - 1]; |
|
|
|
for (var i = 0; i < min.length; i++) { |
|
|
|
for (var i = 0, len = min.length; i < len; i++) { |
|
|
|
if (min[i] != max[i]) { |
|
|
|
return min.slice(0, i); |
|
|
|
} |
|
|
@ -475,7 +475,7 @@ Interface.prototype._ttyWrite = function (b) { |
|
|
|
default: |
|
|
|
var c = b.toString('utf8'); |
|
|
|
var lines = c.split(/\r\n|\n|\r/); |
|
|
|
for (var i = 0; i < lines.length; i++) { |
|
|
|
for (var i = 0, len = lines.length; i < len; i++) { |
|
|
|
if (i > 0) { |
|
|
|
this._ttyWrite(new Buffer([13])); |
|
|
|
} |
|
|
|