[groovy] console: do not execute empty commands

This commit is contained in:
Daniil Ovchinnikov
2015-06-29 15:20:33 +03:00
parent 9650a0e9b6
commit 825a441ff7
@@ -78,7 +78,7 @@ public class GroovyConsole {
myProcessHandler = handler;
}
public void execute(@NotNull String command) {
private void doExecute(@NotNull String command) {
// dirty hack
if (first) {
first = false;
@@ -92,6 +92,10 @@ public class GroovyConsole {
myConsoleView.print("\n", ConsoleViewContentType.NORMAL_OUTPUT);
myConsoleView.print("Result: ", ConsoleViewContentType.SYSTEM_OUTPUT);
send(myProcessHandler, StringUtil.replace(command, "\n", "###\\n"));
}
public void execute(@NotNull String command) {
if (!StringUtil.isEmptyOrSpaces(command)) doExecute(command);
ExecutionManager.getInstance(myProject).getContentManager().toFrontRunContent(defaultExecutor, myContentDescriptor);
}