diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 64a65848d..b6e5b5d1b 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -1041,12 +1041,12 @@ How new tabs are positioned. Valid values: - * +left+: On the left of the current tab. - * +right+: On the right of the current tab. - * +first+: At the left end. - * +last+: At the right end. + * +prev+: Before the current tab. + * +next+: After the current tab. + * +first+: At the beginning. + * +last+: At the end. -Default: +pass:[right]+ +Default: +pass:[next]+ [[tabs-new-tab-position-explicit]] === new-tab-position-explicit @@ -1054,10 +1054,10 @@ How new tabs opened explicitly are positioned. Valid values: - * +left+: On the left of the current tab. - * +right+: On the right of the current tab. - * +first+: At the left end. - * +last+: At the right end. + * +prev+: Before the current tab. + * +next+: After the current tab. + * +first+: At the beginning. + * +last+: At the end. Default: +pass:[last]+ diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index f04066db3..81d8015f2 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -411,6 +411,14 @@ class ConfigManager(QObject): CHANGED_OPTIONS = { ('content', 'cookies-accept'): _get_value_transformer({'default': 'no-3rdparty'}), + ('tabs', 'new-tab-position'): + _get_value_transformer({ + 'left': 'prev', + 'right': 'next'}), + ('tabs', 'new-tab-position-explicit'): + _get_value_transformer({ + 'left': 'prev', + 'right': 'next'}), ('tabs', 'position'): _transform_position, ('tabs', 'select-on-remove'): _get_value_transformer({ diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 64bef47b1..edf5abded 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -583,7 +583,7 @@ def data(readonly=False): "Which tab to select when the focused tab is removed."), ('new-tab-position', - SettingValue(typ.NewTabPosition(), 'right'), + SettingValue(typ.NewTabPosition(), 'next'), "How new tabs are positioned."), ('new-tab-position-explicit', diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 5cec34630..346b5a8d7 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -1436,10 +1436,10 @@ class NewTabPosition(BaseType): def __init__(self, none_ok=False): super().__init__(none_ok) self.valid_values = ValidValues( - ('left', "On the left of the current tab."), - ('right', "On the right of the current tab."), - ('first', "At the left end."), - ('last', "At the right end.")) + ('prev', "Before the current tab."), + ('next', "After the current tab."), + ('first', "At the beginning."), + ('last', "At the end.")) class IgnoreCase(Bool): diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 6efec0851..3bcadc333 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -61,8 +61,8 @@ class TabbedBrowser(tabwidget.TabWidget): _filter: A SignalFilter instance. _now_focused: The tab which is focused now. _tab_insert_idx_left: Where to insert a new tab with - tabbar -> new-tab-position set to 'left'. - _tab_insert_idx_right: Same as above, for 'right'. + tabbar -> new-tab-position set to 'prev'. + _tab_insert_idx_right: Same as above, for 'next'. _undo_stack: List of UndoEntry namedtuples of closed tabs. shutting_down: Whether we're currently shutting down. _local_marks: Jump markers local to each page @@ -410,14 +410,14 @@ class TabbedBrowser(tabwidget.TabWidget): pos = config.get('tabs', 'new-tab-position-explicit') else: pos = config.get('tabs', 'new-tab-position') - if pos == 'left': + if pos == 'prev': idx = self._tab_insert_idx_left # On first sight, we'd think we have to decrement # self._tab_insert_idx_left here, as we want the next tab to be # *before* the one we just opened. However, since we opened a tab - # *to the left* of the currently focused tab, indices will shift by + # *before* of the currently focused tab, indices will shift by # 1 automatically. - elif pos == 'right': + elif pos == 'next': idx = self._tab_insert_idx_right self._tab_insert_idx_right += 1 elif pos == 'first': diff --git a/tests/end2end/features/open.feature b/tests/end2end/features/open.feature index 45012e639..3f6715e6a 100644 --- a/tests/end2end/features/open.feature +++ b/tests/end2end/features/open.feature @@ -75,8 +75,8 @@ Feature: Opening pages Scenario: Opening in a new tab (explicit) Given I open about:blank - When I set tabs -> new-tab-position-explicit to right - And I set tabs -> new-tab-position to left + When I set tabs -> new-tab-position-explicit to next + And I set tabs -> new-tab-position to prev And I run :tab-only And I run :open -t http://localhost:(port)/data/numbers/7.txt And I wait until data/numbers/7.txt is loaded @@ -86,8 +86,8 @@ Feature: Opening pages Scenario: Opening in a new tab (implicit) Given I open about:blank - When I set tabs -> new-tab-position-explicit to right - And I set tabs -> new-tab-position to left + When I set tabs -> new-tab-position-explicit to next + And I set tabs -> new-tab-position to prev And I run :tab-only And I run :open -t -i http://localhost:(port)/data/numbers/8.txt And I wait until data/numbers/8.txt is loaded diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 76dd9ddfd..1663dd8d7 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -821,8 +821,8 @@ Feature: Tab management - data/hints/html/simple.html (active) - data/hello.txt - Scenario: opening tab with tabs->new-tab-position left - When I set tabs -> new-tab-position to left + Scenario: opening tab with tabs->new-tab-position prev + When I set tabs -> new-tab-position to prev And I set tabs -> background-tabs to false And I open about:blank And I open data/hints/html/simple.html in a new tab @@ -833,8 +833,8 @@ Feature: Tab management - data/hello.txt (active) - data/hints/html/simple.html - Scenario: opening tab with tabs->new-tab-position right - When I set tabs -> new-tab-position to right + Scenario: opening tab with tabs->new-tab-position next + When I set tabs -> new-tab-position to next And I set tabs -> background-tabs to false And I open about:blank And I open data/hints/html/simple.html in a new tab