diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2020-07-24 12:12:56 +0200 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2020-07-24 12:12:56 +0200 |
commit | 2f60a91b805346a864a9e0ff06a75a1c02925602 (patch) | |
tree | 5d88056cc5fd38a701225221ab623d086d363aec | |
parent | 6ddf497e10ec5aaef12249e2f7875e726db12875 (diff) | |
download | poezio-2f60a91b805346a864a9e0ff06a75a1c02925602.tar.gz poezio-2f60a91b805346a864a9e0ff06a75a1c02925602.tar.bz2 poezio-2f60a91b805346a864a9e0ff06a75a1c02925602.tar.xz poezio-2f60a91b805346a864a9e0ff06a75a1c02925602.zip |
windows/info_bar: Prevent UnboundLocalError. Thanks genofire
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r-- | poezio/windows/info_bar.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/poezio/windows/info_bar.py b/poezio/windows/info_bar.py index e94e1810..c53ed68a 100644 --- a/poezio/windows/info_bar.py +++ b/poezio/windows/info_bar.py @@ -118,6 +118,10 @@ class VerticalGlobalInfoBar(Win): nb_tabs = len(sorted_tabs) use_nicks = config.get('use_tab_nicks') if nb_tabs >= height: + # TODO: As sorted_tabs filters out gap tabs this ensures pos is + # always set, preventing UnboundLocalError. Now is this how this + # should be fixed. + pos = 0 for y, tab in enumerate(sorted_tabs): if tab.vertical_color == theme.COLOR_VERTICAL_TAB_CURRENT: pos = y |