(rows, columns, matches, current, config, match_format)
| 59 | |
| 60 | |
| 61 | def matches_lines(rows, columns, matches, current, config, match_format): |
| 62 | highlight_color = func_for_letter(config.color_scheme["operator"].lower()) |
| 63 | |
| 64 | if not matches: |
| 65 | return [] |
| 66 | color = func_for_letter(config.color_scheme["main"]) |
| 67 | max_match_width = max(len(m) for m in matches) |
| 68 | words_wide = max(1, (columns - 1) // (max_match_width + 1)) |
| 69 | matches = [match_format(m) for m in matches] |
| 70 | if current: |
| 71 | current = match_format(current) |
| 72 | |
| 73 | matches = paginate(rows, matches, current, words_wide) |
| 74 | |
| 75 | result = [ |
| 76 | fmtstr(" ").join( |
| 77 | ( |
| 78 | color(m.ljust(max_match_width)) |
| 79 | if m != current |
| 80 | else highlight_color(m.ljust(max_match_width)) |
| 81 | ) |
| 82 | for m in matches[i : i + words_wide] |
| 83 | ) |
| 84 | for i in range(0, len(matches), words_wide) |
| 85 | ] |
| 86 | |
| 87 | logger.debug("match: %r" % current) |
| 88 | logger.debug("matches_lines: %r" % result) |
| 89 | return result |
| 90 | |
| 91 | |
| 92 | def formatted_argspec(funcprops, arg_pos, columns, config): |
no test coverage detected