From 14142c320a3204aba6de1e0df7d3b6fb29ba23c5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Nov 2021 13:24:35 +0530 Subject: [PATCH] fix incorrect repeat counts --- kittens/tui/operations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kittens/tui/operations.py b/kittens/tui/operations.py index 3bae316f2..9f50d16f4 100644 --- a/kittens/tui/operations.py +++ b/kittens/tui/operations.py @@ -117,7 +117,9 @@ def without_line_wrap(write: Callable[[str], None]) -> Generator[None, None, Non @cmd def repeat(char: str, count: int) -> str: - return f'{char}\x1b[{abs(count)}b' + if count > 1: + return f'{char}\x1b[{count-1}b' + return char * count @cmd