]> git.armaanb.net Git - lightcards.git/commitdiff
Truncate bar if too long
authorArmaan Bhojwani <me@armaanb.net>
Thu, 11 Feb 2021 23:32:54 +0000 (18:32 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Thu, 11 Feb 2021 23:32:54 +0000 (18:32 -0500)
lightcards/display.py

index de3ffe0a6aaa2769cd5a35335f4897efa7aefd9d..06e8148833254b30e58a810b86f04bd5547e8bed 100644 (file)
@@ -276,7 +276,7 @@ class Display:
         self.win.addstr(
             mlines - 1,
             len(bar_start + bar_middle),
-            bar_end,
+            textwrap.shorten(bar_end, width=mcols - 20, placeholder="…"),
             curses.color_pair(1),
         )