diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-03-01 21:14:03 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-03-01 21:14:03 +0100 |
commit | 643c7fce2ee5e68629a91e2364c6147b5c21d9f3 (patch) | |
tree | 5896ac76c42d3952cbcb083b324f4dcea949ebbf | |
parent | 6509bb824a78a622bb3aa456eaf5389fcf71dbce (diff) | |
parent | 8885ad1392255eceb3f38270f685545934815099 (diff) | |
download | qutebrowser-643c7fce2ee5e68629a91e2364c6147b5c21d9f3.tar.gz qutebrowser-643c7fce2ee5e68629a91e2364c6147b5c21d9f3.zip |
Merge remote-tracking branch 'origin/pr/6123'
-rw-r--r-- | qutebrowser/mainwindow/statusbar/command.py | 7 | ||||
-rw-r--r-- | tests/end2end/features/misc.feature | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/qutebrowser/mainwindow/statusbar/command.py b/qutebrowser/mainwindow/statusbar/command.py index fb09b66db..92408d34f 100644 --- a/qutebrowser/mainwindow/statusbar/command.py +++ b/qutebrowser/mainwindow/statusbar/command.py @@ -187,11 +187,12 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit): Args: rapid: Run the command without closing or clearing the command bar. """ - text = self.text() - self.history.append(text) - was_search = self._handle_search() + text = self.text() + if not (self.prefix() == ':' and text[1:].startswith(' ')): + self.history.append(text) + if not rapid: modeman.leave(self._win_id, usertypes.KeyMode.command, 'cmd accept') diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index f2e098bc7..351135fab 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -468,6 +468,18 @@ Feature: Various utility commands. And I run :command-accept Then the message "blah" should be shown + Scenario: Command starting with space and calling previous command + When I run :set-cmd-text :message-info first + And I run :command-accept + And I wait for "first" in the log + When I run :set-cmd-text : message-info second + And I run :command-accept + And I wait for "second" in the log + And I run :set-cmd-text : + And I run :command-history-prev + And I run :command-accept + Then the message "first" should be shown + Scenario: Calling previous command with :completion-item-focus When I run :set-cmd-text :message-info blah And I wait for "Entering mode KeyMode.command (reason: *)" in the log |