Fix tab_focus_last behaviour with :tab-focus -1

See #4248
This commit is contained in:
Florian Bruhin 2018-09-24 11:06:41 +02:00
parent 9eccaea09c
commit 7b20bf4792

View File

@ -1116,9 +1116,6 @@ class CommandDispatcher:
if index == 'last':
self._tab_focus_last()
return
elif not no_last and index == self._current_index() + 1:
self._tab_focus_last(show_error=False)
return
elif index is None:
self.tab_next()
return
@ -1126,6 +1123,10 @@ class CommandDispatcher:
if index < 0:
index = self._count() + index + 1
if not no_last and index == self._current_index() + 1:
self._tab_focus_last(show_error=False)
return
if 1 <= index <= self._count():
self._set_current_index(index - 1)
else: