mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add isEmptyCommandExecutionAllowed, by default true
This commit is contained in:
@@ -95,7 +95,8 @@ public class ConsoleExecuteAction extends DumbAwareAction {
|
||||
@Override
|
||||
public final void update(AnActionEvent e) {
|
||||
EditorEx editor = myConsole.getConsoleEditor();
|
||||
boolean enabled = !editor.isRendererMode() && isEnabled() && !StringUtil.isEmptyOrSpaces(editor.getDocument().getCharsSequence());
|
||||
boolean enabled = !editor.isRendererMode() && isEnabled() &&
|
||||
(myExecuteActionHandler.isEmptyCommandExecutionAllowed() || !StringUtil.isEmptyOrSpaces(editor.getDocument().getCharsSequence()));
|
||||
if (enabled) {
|
||||
Lookup lookup = LookupManager.getActiveLookup(editor);
|
||||
enabled = lookup == null || !lookup.isCompletion();
|
||||
@@ -128,6 +129,10 @@ public class ConsoleExecuteAction extends DumbAwareAction {
|
||||
return myConsoleHistoryModel;
|
||||
}
|
||||
|
||||
public boolean isEmptyCommandExecutionAllowed() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setAddCurrentToHistory(boolean addCurrentToHistory) {
|
||||
myAddToHistory = addCurrentToHistory;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user