commit 9c2a5a1935a5a406d7e54038b55168ad5cf4b3f7
parent b56c57d80f91b5d725bafd74d96d8bf3d157b2bf
Author: luke8086 <55237178+luke8086@users.noreply.github.com>
Date: Sat, 30 Jul 2022 21:20:57 +0000
Don't wrap lines of code
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/retronews.py b/retronews.py
@@ -271,12 +271,13 @@ def wrap_paragraph(text: str) -> list[str]:
if text.startswith(" "):
# Preserve code indentation
- indent = " "
- elif (match := QUOTE_REX.match(text)) is not None:
+ return [text]
+
+ indent = ""
+
+ if (match := QUOTE_REX.match(text)) is not None:
# Preserve quotation symbols in subsequent lines
indent = match[0]
- else:
- indent = ""
return wrap(text, subsequent_indent=indent, break_on_hyphens=False, break_long_words=False)
@@ -671,6 +672,8 @@ def app_render_pager_line(app: AppState, row: int, line: str) -> None:
line_attr = app_get_pager_line_attr(app, line)
app.screen.move(row, 0)
+ app.screen.clrtoeol()
+ app.screen.move(row, 0)
for word in line.split(" "):
is_url = word.startswith("http://") or word.startswith("https://")