MCPcopy Create free account
hub / github.com/bpython/bpython / paginate

Function paginate

bpython/curtsiesfrontend/replpainter.py:53–58  ·  view source on GitHub ↗
(rows, matches, current, words_wide)

Source from the content-addressed store, hash-verified

51
52
53def paginate(rows, matches, current, words_wide):
54 if current not in matches:
55 current = matches[0]
56 per_page = rows * words_wide
57 current_page = matches.index(current) // per_page
58 return matches[per_page * current_page : per_page * (current_page + 1)]
59
60
61def matches_lines(rows, columns, matches, current, config, match_format):

Callers 1

matches_linesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected