- if (_rl_print_completions_horizontally == 0)
- {
- /* Print the sorted items, up-and-down alphabetically, like ls. */
- for (i = 1; i <= count; i++)
- {
- for (j = 0, l = i; j < limit; j++)
- {
- if (l > len || matches[l] == 0)
- break;
- else
- {
- temp = printable_part (matches[l]);
- printed_len = print_filename (temp, matches[l]);
-
- if (j + 1 < limit)
- for (k = 0; k < max - printed_len; k++)
- tui_putc (' ');
- }
- l += count;
- }
- tui_putc ('\n');
- }
- }
- else
- {
- /* Print the sorted items, across alphabetically, like ls -x. */
- for (i = 1; matches[i]; i++)
- {
- temp = printable_part (matches[i]);
- printed_len = print_filename (temp, matches[i]);
- /* Have we reached the end of this line? */
- if (matches[i+1])
- {
- if (i && (limit > 1) && (i % limit) == 0)
- tui_putc ('\n');
- else
- for (k = 0; k < max - printed_len; k++)
- tui_putc (' ');
- }
- }
- tui_putc ('\n');
- }
+static void
+tui_rl_display_match_list (char **matches, int len, int max)
+{
+ struct match_list_displayer displayer;
+
+ rl_get_screen_size (&displayer.height, &displayer.width);
+ displayer.crlf = tui_mld_crlf;
+ displayer.putch = tui_mld_putch;
+ displayer.puts = tui_mld_puts;
+ displayer.flush = tui_mld_flush;
+ displayer.erase_entire_line = tui_mld_erase_entire_line;
+ displayer.beep = tui_mld_beep;
+ displayer.read_key = tui_mld_read_key;
+
+ gdb_display_match_list (matches, len, max, &displayer);