We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3374ae9 commit c435303Copy full SHA for c435303
src/prompt_toolkit/widgets/base.py
@@ -438,8 +438,10 @@ def get_style() -> str:
438
def _get_text_fragments(self) -> StyleAndTextTuples:
439
width = self.width - (
440
get_cwidth(self.left_symbol) + get_cwidth(self.right_symbol)
441
+ ) + (
442
+ len(self.text) - get_cwidth(self.text)
443
)
- text = (f"{{:^{width}}}").format(self.text)
444
+ text = (f"{{:^{max(0,width)}}}").format(self.text)
445
446
def handler(mouse_event: MouseEvent) -> None:
447
if (
0 commit comments