Skip to content

Commit

Permalink
feat: move cursor to newline rather than getting stuck at the end of …
Browse files Browse the repository at this point in the history
…prev line
  • Loading branch information
mecaneer23 committed Apr 18, 2024
1 parent 0d9b762 commit 375ec3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/acurses.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ def addstr(self, *args: Any, **kwargs: Any) -> None:
def _(self, text: str, attr: int = 0) -> None:
ansi_attrs = self._parse_attrs(attr)
stdout.write(ansi_attrs)
for char in text[:self._width]:
for index, char in enumerate(text[: self._width]):
stdout.write(char)
if index + self._pos_x == self._width:
self.move(self._pos_y, 0)
if ansi_attrs:
stdout.write(_ANSI_RESET)
stdout.flush()
Expand Down

0 comments on commit 375ec3c

Please sign in to comment.