parent
76c5c8bf8e
commit
b30ca6bcb6
@ -21,6 +21,7 @@
|
||||
|
||||
from PyQt5.QtCore import pyqtSlot
|
||||
|
||||
from qutebrowser.config import config
|
||||
from qutebrowser.utils import usertypes, log
|
||||
|
||||
|
||||
@ -43,6 +44,7 @@ class History:
|
||||
"""Command history.
|
||||
|
||||
Attributes:
|
||||
handle_private_mode: Whether to ignore history in private mode.
|
||||
history: A list of executed commands, with newer commands at the end.
|
||||
_tmphist: Temporary history for history browsing (as NeighborList)
|
||||
"""
|
||||
@ -53,6 +55,7 @@ class History:
|
||||
Args:
|
||||
history: The initial history to set.
|
||||
"""
|
||||
self.handle_private_mode = False
|
||||
self._tmphist = None
|
||||
if history is None:
|
||||
self.history = []
|
||||
@ -120,5 +123,8 @@ class History:
|
||||
Args:
|
||||
text: The text to append.
|
||||
"""
|
||||
if (self.handle_private_mode and
|
||||
config.get('general', 'private-browsing')):
|
||||
return
|
||||
if not self.history or text != self.history[-1]:
|
||||
self.history.append(text)
|
||||
|
@ -64,6 +64,7 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
|
||||
misc.CommandLineEdit.__init__(self, parent)
|
||||
misc.MinimalLineEditMixin.__init__(self)
|
||||
self._win_id = win_id
|
||||
self.history.handle_private_mode = True
|
||||
self.history.history = objreg.get('command-history').data
|
||||
self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Ignored)
|
||||
self.cursorPositionChanged.connect(self.update_completion)
|
||||
|
Loading…
Reference in New Issue
Block a user