Merge branch 'issue-716' of https://github.com/Carpetsmoker/qutebrowser into Carpetsmoker-issue-716
This commit is contained in:
commit
708d0d9c27
@ -685,6 +685,7 @@ How many steps to zoom out.
|
||||
[options="header",width="75%",cols="25%,75%"]
|
||||
|==============
|
||||
|Command|Description
|
||||
|<<clear-keychain,clear-keychain>>|Clear the currently entered key chain.
|
||||
|<<command-accept,command-accept>>|Execute the command currently in the commandline.
|
||||
|<<command-history-next,command-history-next>>|Go forward in the commandline history.
|
||||
|<<command-history-prev,command-history-prev>>|Go back in the commandline history.
|
||||
@ -739,6 +740,10 @@ How many steps to zoom out.
|
||||
|<<toggle-selection,toggle-selection>>|Toggle caret selection mode.
|
||||
|<<yank-selected,yank-selected>>|Yank the selected text to the clipboard or primary selection.
|
||||
|==============
|
||||
[[clear-keychain]]
|
||||
=== clear-keychain
|
||||
Clear the currently entered key chain.
|
||||
|
||||
[[command-accept]]
|
||||
=== command-accept
|
||||
Execute the command currently in the commandline.
|
||||
|
@ -1143,7 +1143,7 @@ KEY_DATA = collections.OrderedDict([
|
||||
])),
|
||||
|
||||
('normal', collections.OrderedDict([
|
||||
('search', ['<Escape>']),
|
||||
('search ;; clear-keychain', ['<Escape>']),
|
||||
('set-cmd-text -s :open', ['o']),
|
||||
('set-cmd-text :open {url}', ['go']),
|
||||
('set-cmd-text -s :open -t', ['O']),
|
||||
@ -1354,4 +1354,6 @@ CHANGED_KEY_COMMANDS = [
|
||||
(re.compile(r'^scroll 0 -50$'), r'scroll up'),
|
||||
(re.compile(r'^scroll 50 0$'), r'scroll right'),
|
||||
(re.compile(r'^scroll ([-\d]+ [-\d]+)$'), r'scroll-px \1'),
|
||||
|
||||
(re.compile(r'^search$'), r'search ;; clear-keychain'),
|
||||
]
|
||||
|
@ -165,12 +165,6 @@ class BaseKeyParser(QObject):
|
||||
key = e.key()
|
||||
self._debug_log("Got key: 0x{:x} / text: '{}'".format(key, txt))
|
||||
|
||||
if key == Qt.Key_Escape:
|
||||
self._debug_log("Escape pressed, discarding '{}'.".format(
|
||||
self._keystring))
|
||||
self._keystring = ''
|
||||
return self.Match.none
|
||||
|
||||
if len(txt) == 1:
|
||||
category = unicodedata.category(txt)
|
||||
is_control_char = (category == 'Cc')
|
||||
@ -306,6 +300,7 @@ class BaseKeyParser(QObject):
|
||||
True if the event was handled, False otherwise.
|
||||
"""
|
||||
handled = self._handle_special_key(e)
|
||||
|
||||
if handled or not self._supports_chains:
|
||||
return handled
|
||||
match = self._handle_single_key(e)
|
||||
@ -362,3 +357,9 @@ class BaseKeyParser(QObject):
|
||||
"defined!")
|
||||
if mode == self._modename:
|
||||
self.read_config()
|
||||
|
||||
def clear_keystring(self):
|
||||
"""Clear the currently entered key sequence."""
|
||||
self._debug_log("discarding keystring '{}'.".format(self._keystring))
|
||||
self._keystring = ''
|
||||
self.keystring_updated.emit(self._keystring)
|
||||
|
@ -317,3 +317,8 @@ class ModeManager(QObject):
|
||||
return self._eventFilter_keypress(event)
|
||||
else:
|
||||
return self._eventFilter_keyrelease(event)
|
||||
|
||||
@cmdutils.register(instance='mode-manager', scope='window', hide=True)
|
||||
def clear_keychain(self):
|
||||
"""Clear the currently entered key chain."""
|
||||
self._parsers[self.mode].clear_keystring()
|
||||
|
Loading…
Reference in New Issue
Block a user