mypy: Fix int-issues in commands.py
This commit is contained in:
parent
08bd47bc16
commit
923fd89323
@ -75,7 +75,7 @@ class CommandDispatcher:
|
|||||||
new_window.show()
|
new_window.show()
|
||||||
return new_window.tabbed_browser
|
return new_window.tabbed_browser
|
||||||
|
|
||||||
def _count(self):
|
def _count(self) -> int:
|
||||||
"""Convenience method to get the widget count."""
|
"""Convenience method to get the widget count."""
|
||||||
return self._tabbed_browser.widget.count()
|
return self._tabbed_browser.widget.count()
|
||||||
|
|
||||||
@ -1143,6 +1143,8 @@ class CommandDispatcher:
|
|||||||
self.tab_next()
|
self.tab_next()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
assert isinstance(index, int)
|
||||||
|
|
||||||
if index < 0:
|
if index < 0:
|
||||||
index = self._count() + index + 1
|
index = self._count() + index + 1
|
||||||
|
|
||||||
@ -1184,6 +1186,7 @@ class CommandDispatcher:
|
|||||||
if config.val.tabs.wrap:
|
if config.val.tabs.wrap:
|
||||||
new_idx %= self._count()
|
new_idx %= self._count()
|
||||||
else:
|
else:
|
||||||
|
assert isinstance(index, int)
|
||||||
# absolute moving
|
# absolute moving
|
||||||
if count is not None:
|
if count is not None:
|
||||||
new_idx = count - 1
|
new_idx = count - 1
|
||||||
|
Loading…
Reference in New Issue
Block a user