Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
33787b1
readline: Added failing test for tab completion
mtharrison Aug 29, 2015
eeffc20
readline: fixed issue with tab completion
mtharrison Aug 29, 2015
a493dab
cpplint: make it possible to run outside git repo
bnoordhuis Sep 5, 2015
b3c4cec
build: make .msi install to "nodejs", not "node"
rvagg Sep 5, 2015
cdfa271
doc: update AUTHORS list
rvagg Aug 31, 2015
7ee58be
crypto: replace rwlocks with simple mutexes
bnoordhuis Sep 7, 2015
3bc7e58
child_process: use stdio.fd even if it is 0
evanlucas Sep 7, 2015
278a926
src: s/ia32/x86 for process.release.libUrl for win
rvagg Sep 5, 2015
b8341e8
deps: float node-gyp v3.0.0
rvagg Sep 5, 2015
154d3f5
build: remote commands on staging in single session
rvagg Sep 7, 2015
c7be08c
cluster: allow shared reused dgram sockets
indutny Aug 25, 2015
31450fc
deps: improve ArrayBuffer performance in v8
indutny Sep 8, 2015
22097a2
node-gyp: float 3.0.1, minor fix for download url
rvagg Sep 8, 2015
297b9ae
build: fix v8_enable_handle_zapping override
skomski Sep 7, 2015
8f87169
doc: fix comma splice in Assertion Testing doc
Trott Sep 7, 2015
380a3d8
2015-09-08, Version 4.0.0 (Stable) Release
rvagg Sep 7, 2015
f8152df
test: expect error for test_lookup_ipv6_hint on FreeBSD
Trott Sep 7, 2015
f442904
doc: describe process API for IPC
sam-github Jun 15, 2015
81a0c0b
win,msi: fix documentation shortcut url
mscdex Sep 10, 2015
d2f70fe
doc: use 3rd person singular for consistency
agcolom Sep 9, 2015
a6d674d
bindings: close after reading module struct
indutny Sep 10, 2015
acb6779
deps: cherry-pick 6da51b4 from v8's upstream
indutny Sep 10, 2015
e1fb0e8
doc: use US English for consistency
agcolom Sep 9, 2015
a1949e8
test: remove valid hostname check in test-dns.js
Trott Sep 9, 2015
2aed0aa
readline: Added failing test for tab completion
mtharrison Aug 29, 2015
e9fd78d
readline: fixed issue with tab completion
mtharrison Aug 29, 2015
ac3f7f4
readline: var => const
mtharrison Sep 11, 2015
9831203
Mergefix
mtharrison Sep 11, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
readline: fixed issue with tab completion
Fixes an issue where tab completion groups aren't shown if the output stream column size is undefined.
  • Loading branch information
mtharrison committed Sep 11, 2015
commit e9fd78d94d7135a1c0565e53141e59bae433ec67
5 changes: 4 additions & 1 deletion lib/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ Interface.prototype._tabComplete = function() {
var width = completions.reduce(function(a, b) {
return a.length > b.length ? a : b;
}).length + 2; // 2 space padding
var maxColumns = Math.floor(self.columns / width) || 1;
var maxColumns = Math.floor(self.columns / width);
if (!maxColumns || maxColumns === Infinity) {
maxColumns = 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I see that this fixes the issue, I'm not sure exactly why it does so. With self.columns being undefined, the division should result in NaN. Care to explain why it results in Infinity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sneaky!

var group = [], c;
for (var i = 0, compLen = completions.length; i < compLen; i++) {
c = completions[i];
Expand Down