Skip to content

Commit 0af7af9

Browse files
committed
Merge branch 'master' of https://github.com/molly-cactus/kitty
2 parents 1987098 + 2b3e2ea commit 0af7af9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
5050

5151
- Fix mapping ``remote_control send-text`` not working (:iss:`3147`)
5252

53+
- Add a ``right`` option for :opt:`tab_switch_strategy` (:pull:`3155`)
54+
5355

5456
0.19.2 [2020-11-13]
5557
-------------------

kitty/config_data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,11 +880,12 @@ def tab_bar_min_tabs(x: str) -> int:
880880
The minimum number of tabs that must exist before the tab bar is shown
881881
'''))
882882

883-
o('tab_switch_strategy', 'previous', option_type=choices('previous', 'left', 'last'), long_text=_('''
883+
o('tab_switch_strategy', 'previous', option_type=choices('previous', 'left', 'right', 'last'), long_text=_('''
884884
The algorithm to use when switching to a tab when the current tab is closed.
885885
The default of :code:`previous` will switch to the last used tab. A value of
886886
:code:`left` will switch to the tab to the left of the closed tab. A value
887-
of :code:`last` will switch to the right-most tab.
887+
of :code:`right` will switch to the tab to the right of the closed tab.
888+
A value of :code:`last` will switch to the right-most tab.
888889
'''))
889890

890891

kitty/tabs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ def remove(self, tab: Tab) -> None:
721721
break
722722
elif self.opts.tab_switch_strategy == 'left':
723723
next_active_tab = max(0, self.active_tab_idx - 1)
724+
elif self.opts.tab_switch_strategy == 'right':
725+
next_active_tab = min(self.active_tab_idx, len(self.tabs) - 1)
724726

725727
if next_active_tab < 0:
726728
next_active_tab = max(0, min(self.active_tab_idx, len(self.tabs) - 1))

0 commit comments

Comments
 (0)