From f59a14758980ec76779bf2957c9a71a9ac844912 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 13 May 2015 07:58:33 +0200 Subject: [PATCH] Leave mode when yanking by default. See #653. --- qutebrowser/browser/commands.py | 6 +++--- qutebrowser/config/configdata.py | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index e5f646dcb..3b71fc4f4 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1389,12 +1389,12 @@ class CommandDispatcher: @cmdutils.register(instance='command-dispatcher', hide=True, modes=[KeyMode.caret], scope='window') - def yank_selected(self, sel=False, leave=False): + def yank_selected(self, sel=False, keep=False): """Yank the selected text to the clipboard or primary selection. Args: sel: Use the primary selection instead of the clipboard. - leave: If given, leave visual mode after yanking. + keep: If given, stay in visual mode after yanking. """ s = self._current_widget().selectedText() if not self._current_widget().hasSelection() or len(s) == 0: @@ -1412,7 +1412,7 @@ class CommandDispatcher: clipboard.setText(s, mode) message.info(self._win_id, "{} {} yanked to {}".format( len(s), "char" if len(s) == 1 else "chars", target)) - if leave: + if not keep: modeman.leave(self._win_id, KeyMode.caret, "yank selected") @cmdutils.register(instance='command-dispatcher', hide=True, diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 6fe88b5e1..33be98db8 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -1279,9 +1279,8 @@ KEY_DATA = collections.OrderedDict([ ('move-to-end-of-line', ['$']), ('move-to-start-of-document', ['gg']), ('move-to-end-of-document', ['G']), - ('yank-selected', ['y']), ('yank-selected -p', ['Y']), - ('yank-selected --leave', ['', '']), + ('yank-selected', ['y', '', '']), ('scroll -50 0', ['H']), ('scroll 0 50', ['J']), ('scroll 0 -50', ['K']),