Skip to content

Commit

Permalink
fix: prevent spurious newlines when printing text larger than the con…
Browse files Browse the repository at this point in the history
…sole width
  • Loading branch information
netomi committed Dec 10, 2024
1 parent 558c8ae commit b9ee5b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions otterdog/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ def print(self, text: str = "", highlight: bool = False) -> None:
self._print_indentation()

if line.endswith("\n"):
self._console.print(line[:-1], end="", highlight=highlight)
self._console.print(line[:-1], end="", highlight=highlight, new_line_start=True)
self.print_line_break()
else:
self._console.print(line, end="", highlight=highlight)
self._console.print(line, end="", highlight=highlight, new_line_start=True)

def println(self, text: str = "", highlight: bool = False) -> None:
self.print(text, highlight=highlight)
Expand Down

0 comments on commit b9ee5b6

Please sign in to comment.