Add some tests for the pagerhist code

This commit is contained in:
Kovid Goyal
2020-09-21 09:08:46 +05:30
parent a78515e5bf
commit bf19d2b156
5 changed files with 123 additions and 102 deletions

View File

@@ -158,7 +158,9 @@ def as_text(
f(lines.append, as_ansi, add_wrap_markers)
if add_history:
h: List[str] = []
screen.historybuf.pagerhist_as_text(h.append)
pht = screen.historybuf.pagerhist_as_text()
if pht:
h.append(pht)
if h and (not as_ansi or not add_wrap_markers):
sanitizer = text_sanitizer(as_ansi, add_wrap_markers)
h = list(map(sanitizer, h))