diff options
Diffstat (limited to 'qutebrowser/completion/models/miscmodels.py')
-rw-r--r-- | qutebrowser/completion/models/miscmodels.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qutebrowser/completion/models/miscmodels.py b/qutebrowser/completion/models/miscmodels.py index 0aa30d184..77072c720 100644 --- a/qutebrowser/completion/models/miscmodels.py +++ b/qutebrowser/completion/models/miscmodels.py @@ -103,7 +103,7 @@ def session(*, info=None): return model -def _tabs(*, win_id_filter=lambda _win_id: True, add_win_id=True, cur_win_id=0): +def _tabs(*, win_id_filter=lambda _win_id: True, add_win_id=True, cur_win_id=None): """Helper to get the completion model for tabs/other_tabs. Args: @@ -114,9 +114,11 @@ def _tabs(*, win_id_filter=lambda _win_id: True, add_win_id=True, cur_win_id=0): """ def delete_tab(data): """Close the selected tab.""" - win_id = cur_win_id - # data[0] can be 'tabInd' or 'winID/tabInd' - tab_index = data[0].split('/')[-1] + if cur_win_id is None: + win_id, tab_index = data[0].split('/') + else: + win_id = cur_win_id + tab_index = data[0] tabbed_browser = objreg.get('tabbed-browser', scope='window', window=int(win_id)) |