From 2c8eafb7ab4e3691041ae8961bef9af5a93bf1b0 Mon Sep 17 00:00:00 2001 From: Viktor Shatrov Date: Mon, 21 Jan 2019 15:02:34 +0300 Subject: [PATCH] (WEB-36682) Take into account 'canPause' in PauseOutputAction --- .../execution/actions/PauseOutputAction.java | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/execution/actions/PauseOutputAction.java b/platform/lang-impl/src/com/intellij/execution/actions/PauseOutputAction.java index 0106fcae9117..937eaaa3868f 100644 --- a/platform/lang-impl/src/com/intellij/execution/actions/PauseOutputAction.java +++ b/platform/lang-impl/src/com/intellij/execution/actions/PauseOutputAction.java @@ -42,23 +42,24 @@ public class PauseOutputAction extends ToggleAction implements DumbAware { public void update(@NotNull AnActionEvent event) { super.update(event); final Presentation presentation = event.getPresentation(); - RunContentDescriptor descriptor = StopAction.getRecentlyStartedContentDescriptor(event.getDataContext()); - ProcessHandler handler = descriptor != null ? descriptor.getProcessHandler() : null; - if (handler != null && !handler.isProcessTerminated()) { - presentation.setEnabled(true); + ConsoleView consoleView = getConsoleView(event); + if (consoleView == null || !consoleView.canPause()) { + presentation.setEnabled(false); + return; + } + if (!consoleView.hasDeferredOutput()) { + presentation.setEnabled(false); } else { - ConsoleView consoleView = getConsoleView(event); - if (consoleView == null || !consoleView.canPause()) { - presentation.setEnabled(false); - return; - } - if (!consoleView.hasDeferredOutput()) { - presentation.setEnabled(false); - } - else { + RunContentDescriptor descriptor = StopAction.getRecentlyStartedContentDescriptor(event.getDataContext()); + ProcessHandler handler = descriptor != null ? descriptor.getProcessHandler() : null; + if (handler != null && !handler.isProcessTerminated()) { presentation.setEnabled(true); } + else { + presentation.setEnabled(false); + } } + } } \ No newline at end of file