From ee5c710464e813be6ba2f433986c1bae72de2d22 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 11 May 2020 11:05:19 +0530 Subject: [PATCH] minor changes --- mitmproxy/tools/console/tabs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mitmproxy/tools/console/tabs.py b/mitmproxy/tools/console/tabs.py index 94e30416c..07b617a1c 100644 --- a/mitmproxy/tools/console/tabs.py +++ b/mitmproxy/tools/console/tabs.py @@ -50,7 +50,7 @@ class Tabs(urwid.WidgetWrap): headers = [] for i in range(len(self.tabs)): txt = self.tabs[i][0]() - if i == self.tab_offset or (len(self.tabs) <= self.tab_offset and i == 0): + if i == self.tab_offset % len(self.tabs): headers.append( Tab( i, @@ -70,7 +70,7 @@ class Tabs(urwid.WidgetWrap): ) headers = urwid.Columns(headers, dividechars=1) self._w = urwid.Frame( - body = self.tabs[self.tab_offset if len(self.tabs) < self.tab_offset else 0][1](), + body = self.tabs[self.tab_offset % len(self.tabs)][1](), header = headers ) self._w.set_focus("body")