summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schlachter <t480-debian-git@schlachter.ca>2026-01-13 09:20:09 -0500
committerDavid Schlachter <t480-debian-git@schlachter.ca>2026-01-13 09:20:09 -0500
commit173f2ad8a1ec5ee917d07595313ebd0dbcdf0910 (patch)
treea7b9b2b56e00eb767cc79bc03ee25e082a9852fe
parentd7b7f13132365ffe0762a74662fb68bd01cfc6d8 (diff)
Pad the definition viewport a bit
-rw-r--r--ui.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui.go b/ui.go
index 05c7e7d..95fed74 100644
--- a/ui.go
+++ b/ui.go
@@ -215,8 +215,9 @@ func formatDefinitionForDisplay(policy bluemonday.Policy, definition string, max
str = strings.ReplaceAll(str, "\t- ", "\x1b[0;33;49m•\x1b[0m ")
// Limit the width of the displayed definition to 80 characters, or the
- // width of the viewport (whichever is smaller).
- width := min(maxWidth, 80)
+ // width of the viewport (whichever is smaller). (Add one character of
+ // padding too -- seems to prevent weird line breaks)
+ width := min(maxWidth-1, 80-1)
return wordwrap.String(str, width)
}