Merge commit '7f13c9a3c31aa719144ca3afcad7af305dd2f6ed' into Carpetsmoker/relax-cmdline

This commit is contained in:
Florian Bruhin 2017-04-02 18:47:00 +02:00
commit b20267b57d
2 changed files with 14 additions and 3 deletions

View File

@ -133,7 +133,8 @@ class CommandRunner(QObject):
Yields:
ParseResult tuples.
"""
if not text.strip():
text = text.strip().lstrip(':').strip()
if not text:
raise cmdexc.NoSuchCommandError("No command given")
if aliases:

View File

@ -538,6 +538,16 @@ Feature: Various utility commands.
When I run :message-i "Hello World" (invalid command)
Then the error "message-i: no such command" should be shown
Scenario: Multiple leading : in command
When I run :::::set-cmd-text ::::message-i "Hello World"
And I run :command-accept
Then the message "Hello World" should be shown
Scenario: Whitespace in command
When I run : : set-cmd-text : : message-i "Hello World"
And I run :command-accept
Then the message "Hello World" should be shown
# We can't run :message-i as startup command, so we use
# :set-cmd-text
@ -632,7 +642,7 @@ Feature: Various utility commands.
And I run :command-history-prev
And I run :command-accept
Then the message "blah" should be shown
Scenario: Browsing through commands
When I run :set-cmd-text :message-info blarg
And I run :command-accept
@ -644,7 +654,7 @@ Feature: Various utility commands.
And I run :command-history-next
And I run :command-accept
Then the message "blarg" should be shown
Scenario: Calling previous command when history is empty
Given I have a fresh instance
When I run :set-cmd-text :