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