summaryrefslogtreecommitdiff
path: root/qutebrowser/mainwindow/tabbedbrowser.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-07-28 19:55:17 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-07-28 19:55:17 +0200
commit72a4f3086d619b2841f8dff72cdbdcf50bf7ded8 (patch)
treebcefdabc60656d124508a70995a3df1b2610e956 /qutebrowser/mainwindow/tabbedbrowser.py
parent2e28db1f4194e1c4c1186ddc49e659446be8e98d (diff)
parenta1e3cb72fa4a3d535257e6b0ea1256d5b923d7f1 (diff)
downloadqutebrowser-72a4f3086d619b2841f8dff72cdbdcf50bf7ded8.tar.gz
qutebrowser-72a4f3086d619b2841f8dff72cdbdcf50bf7ded8.zip
Merge remote-tracking branch 'origin/pr/5207'
Diffstat (limited to 'qutebrowser/mainwindow/tabbedbrowser.py')
-rw-r--r--qutebrowser/mainwindow/tabbedbrowser.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py
index 5840ae36f..39df067b6 100644
--- a/qutebrowser/mainwindow/tabbedbrowser.py
+++ b/qutebrowser/mainwindow/tabbedbrowser.py
@@ -494,7 +494,7 @@ class TabbedBrowser(QWidget):
tab.deleteLater()
- def undo(self):
+ def undo(self, count=1):
"""Undo removing of a tab or tabs."""
# Remove unused tab which may be created after the last tab is closed
last_close = config.val.tabs.last_close
@@ -517,7 +517,10 @@ class TabbedBrowser(QWidget):
use_current_tab = (only_one_tab_open and no_history and
last_close_url_used)
- for entry in reversed(self.undo_stack.pop()):
+ entries = self.undo_stack[-count]
+ del self.undo_stack[-count]
+
+ for entry in reversed(entries):
if use_current_tab:
newtab = self.widget.widget(0)
use_current_tab = False