From: Armaan Bhojwani Date: Thu, 11 Feb 2021 23:32:54 +0000 (-0500) Subject: Truncate bar if too long X-Git-Tag: v0.6.0~16 X-Git-Url: https://git.armaanb.net/phrases/tree/LICENSE?a=commitdiff_plain;h=c0b68087aa5cc9a901c27179bd42eb6082b22e67;p=lightcards.git Truncate bar if too long --- diff --git a/lightcards/display.py b/lightcards/display.py index de3ffe0..06e8148 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -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), )