diff options
author | Maxime Buquet <pep@bouah.net> | 2020-07-24 12:18:47 +0200 |
---|---|---|
committer | Maxime Buquet <pep@bouah.net> | 2020-07-24 12:18:47 +0200 |
commit | 37cebbceb0f31726e2e7960db110e58b31bcae9e (patch) | |
tree | 5d88056cc5fd38a701225221ab623d086d363aec | |
parent | 6ddf497e10ec5aaef12249e2f7875e726db12875 (diff) | |
parent | 2f60a91b805346a864a9e0ff06a75a1c02925602 (diff) | |
download | poezio-37cebbceb0f31726e2e7960db110e58b31bcae9e.tar.gz poezio-37cebbceb0f31726e2e7960db110e58b31bcae9e.tar.bz2 poezio-37cebbceb0f31726e2e7960db110e58b31bcae9e.tar.xz poezio-37cebbceb0f31726e2e7960db110e58b31bcae9e.zip |
Merge branch 'info-bar-pos' into 'master'
windows/info_bar: Prevent UnboundLocalError. Thanks genofire
See merge request poezio/poezio!151
-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 |