def rl_display_match_list(matches, len, max)
max += 2
limit = @_rl_screenwidth / max
if (limit != 1 && (limit * max == @_rl_screenwidth))
limit-=1
end
if (limit == 0)
limit = 1
end
count = (len + (limit - 1)) / limit
if (!@rl_ignore_completion_duplicates)
matches[1,len] = matches[1,len].sort
end
rl_crlf()
lines = 0
if (!@_rl_print_completions_horizontally)
for i in 1 .. count
l = i
for j in 0 ... limit
if (l > len || matches[l].nil?)
break
else
temp = printable_part(matches[l])
printed_len = print_filename(temp, matches[l])
if (j + 1 < limit)
@rl_outstream.write(' '*(max - printed_len))
end
end
l += count
end
rl_crlf()
lines+=1
if (@_rl_page_completions && lines >= (@_rl_screenheight - 1) && i < count)
lines = _rl_internal_pager(lines)
return if (lines < 0)
end
end
else
i = 1
while(matches[i])
temp = printable_part(matches[i])
printed_len = print_filename(temp, matches[i])
if (matches[i+1])
if ((limit > 1) && (i % limit) == 0)
rl_crlf()
lines+=1
if (@_rl_page_completions && lines >= @_rl_screenheight - 1)
lines = _rl_internal_pager(lines)
return if (lines < 0)
end
else
@rl_outstream.write(' '*(max - printed_len))
end
end
i += 1
end
rl_crlf()
end
end