private void HandleCancel(RCompletionController controller) { if (!controller.HasActiveCompletionSession && !controller.HasActiveSignatureSession(TextView)) { Workflow.Operations.CancelAsync().DoNotWait(); // Post interrupt command which knows if it can interrupt R or not Workflow.Shell.PostCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdInterruptR); } }
private bool HandleCancel(RCompletionController controller) { if (controller.HasActiveCompletionSession || controller.HasActiveSignatureSession(TextView)) { controller.DismissAllSessions(); return(true); } // If session is reading user input, do not terminate it if (!Workflow.RSession.IsReadingUserInput) { Workflow.Shell.PostCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdInterruptR); } return(false); }