goto_tab now maps numbers larger than the last tab to the last tab
Fixes #2291
This commit is contained in:
parent
f5090c951a
commit
96f3253e6d
3 changed files with 9 additions and 3 deletions
|
|
@ -33,6 +33,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||
|
||||
- Fix a segfault when using :option:`kitty --debug-config` with maps (:iss:`2270`)
|
||||
|
||||
- ``goto_tab`` now maps numbers larger than the last tab to the last tab
|
||||
(:iss:`2291`)
|
||||
|
||||
|
||||
0.15.1 [2019-12-21]
|
||||
--------------------
|
||||
|
|
|
|||
|
|
@ -144,7 +144,8 @@ def uniq(vals, result_type=list):
|
|||
_('Tab management'), '',
|
||||
_('''\
|
||||
You can also create shortcuts to go to specific tabs, with 1 being the first
|
||||
tab, 2 the second tab and -1 being the previously active tab::
|
||||
tab, 2 the second tab and -1 being the previously active tab, and any number
|
||||
larger than the last tab being the last tab::
|
||||
|
||||
map ctrl+alt+1 goto_tab 1
|
||||
map ctrl+alt+2 goto_tab 2
|
||||
|
|
|
|||
|
|
@ -560,9 +560,11 @@ def next_tab(self, delta=1):
|
|||
self.set_active_tab_idx((self.active_tab_idx + len(self.tabs) + delta) % len(self.tabs))
|
||||
|
||||
def goto_tab(self, tab_num):
|
||||
if 0 <= tab_num < len(self.tabs):
|
||||
if tab_num >= len(self.tabs):
|
||||
tab_num = max(0, len(self.tabs) - 1)
|
||||
if tab_num >= 0:
|
||||
self.set_active_tab_idx(tab_num)
|
||||
elif tab_num < 0:
|
||||
else:
|
||||
try:
|
||||
old_active_tab_id = self.active_tab_history[tab_num]
|
||||
except IndexError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue