Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions qutebrowser/config/configdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,14 @@ tabs.pinned.frozen:
default: True
desc: Force pinned tabs to stay at fixed URL.

tabs.undo_stack_size:
default: 100
type:
name: Int
minval: -1
maxval: maxint
desc: Number of close tab actions to remember, per window (-1 for no maximum).

tabs.wrap:
default: true
type: Bool
Expand Down
14 changes: 13 additions & 1 deletion qutebrowser/mainwindow/tabbedbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

"""The main tabbed browser widget."""

import collections
import functools

import attr
Expand Down Expand Up @@ -131,7 +132,9 @@ def __init__(self, *, win_id, private, parent=None):
else:
self.cur_load_started.connect(self._leave_modes_on_load)

self._undo_stack = []
# This init is never used, it is immediately thrown away in the next line.
self._undo_stack = collections.deque()
self._update_stack_size()
self._filter = signalfilter.SignalFilter(win_id, self)
self._now_focused = None
self.search_text = None
Expand All @@ -142,6 +145,13 @@ def __init__(self, *, win_id, private, parent=None):
self.is_private = private
config.instance.changed.connect(self._on_config_changed)

def _update_stack_size(self):
newsize = config.instance.get('tabs.undo_stack_size')
if newsize < 0:
newsize = None
# We can't resize a collections.deque so just recreate it >:(
self._undo_stack = collections.deque(self._undo_stack, maxlen=newsize)

def __repr__(self):
return utils.get_repr(self, count=self.widget.count())

Expand All @@ -151,6 +161,8 @@ def _on_config_changed(self, option):
self._update_favicons()
elif option == 'window.title_format':
self._update_window_title()
elif option == 'tabs.undo_stack_size':
self._update_stack_size()
elif option in ['tabs.title.format', 'tabs.title.format_pinned']:
self.widget.update_tab_titles()

Expand Down