From 2b08654d7c0f2b7d3679848beba5f3bc273d79cc Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Tue, 20 Aug 2019 22:34:38 -0600 Subject: [PATCH] Fixed _get_separator_length() * Use title line(s) and 'Display Name' instead of name * Menu()._update() is required to be run previously --- scripts/wk/std.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/wk/std.py b/scripts/wk/std.py index de783b81..0c748c37 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -128,10 +128,14 @@ class Menu(): """Format separator length based on name lengths, returns str.""" separator_length = 0 + # Check title line(s) + for line in self.title.split('\n'): + separator_length = max(separator_length, len(line)) + # Loop over all item names for section in (self.actions, self.options, self.sets, self.toggles): - for name in section.keys(): - separator_length = max(separator_length, len(name)) + for details in section.values(): + separator_length = max(separator_length, len(details['Display Name'])) separator_length += 1 # Done