Browse Source

Fix inline header indentation

Sebastian Lohff 1 year ago
parent
commit
e0177d0e10
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      clintermission/climenu.py

+ 3
- 3
clintermission/climenu.py View File

@@ -97,9 +97,9 @@ class CliMenu:
97 97
             for option in options:
98 98
                 self.add_option(option)
99 99
 
100
-    def add_header(self, title, indent=False):
100
+    def add_header(self, title, indent=True):
101 101
         for text in title.split('\n'):
102
-            self._items.append(CliMenuHeader(text))
102
+            self._items.append(CliMenuHeader(text, indent=indent))
103 103
 
104 104
     def add_option(self, text, item=None):
105 105
         self._items.append(CliMenuOption(text, self._item_num, item=item))
@@ -146,7 +146,7 @@ class CliMenu:
146 146
                 style = s.option_style
147 147
         else:
148 148
             if item.indent:
149
-                indent += ' ' * self._header_indent
149
+                indent += ' ' * (self._header_indent + len(self._cursor) + 1)
150 150
             style = s.header_style
151 151
 
152 152
         return Transformation([('', indent), (style, prefix + text)])

Loading…
Cancel
Save