From e61986b8da4dc659e99ebe6e2891d17a55afeca1 Mon Sep 17 00:00:00 2001 From: dougollerenshaw Date: Fri, 20 Sep 2024 15:02:14 -0700 Subject: [PATCH] Give more space to line numbers in code popup --- codeaide/ui/code_popup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codeaide/ui/code_popup.py b/codeaide/ui/code_popup.py index 206b713..44294b9 100644 --- a/codeaide/ui/code_popup.py +++ b/codeaide/ui/code_popup.py @@ -64,8 +64,8 @@ def __init__(self, parent=None): def line_number_area_width(self): digits = len(str(max(1, self.blockCount()))) - space = 3 + self.fontMetrics().horizontalAdvance("9") * digits - return space + space = 3 + self.fontMetrics().horizontalAdvance("9") * (digits + 1) + return min(space, 50) # Cap the width at 50 pixels def update_line_number_area_width(self, _): self.setViewportMargins(