@@ -18,7 +18,7 @@ object TerminalUtil {
18
18
fun sendMsg (project : Project , data : String , e : AnActionEvent ) {
19
19
val content = getContent(project) ? : return
20
20
val findWidgetByContent = TerminalToolWindowManager .findWidgetByContent(content) ? : return
21
- val controller: TerminalPromptController ? = tryGetBlockTerminalEditor (findWidgetByContent)
21
+ val controller: TerminalPromptController ? = lookupTerminalPromptControllerByView (findWidgetByContent)
22
22
if (controller == null ) {
23
23
trySendMsgInOld(project, data, content)
24
24
return
@@ -36,7 +36,7 @@ object TerminalUtil {
36
36
})
37
37
}
38
38
39
- private fun tryGetBlockTerminalEditor (findWidgetByContent : TerminalWidget ): TerminalPromptController ? {
39
+ private fun lookupTerminalPromptControllerByView (findWidgetByContent : TerminalWidget ): TerminalPromptController ? {
40
40
val terminalView = (findWidgetByContent.component as ? Wrapper )?.targetComponent ? : return null
41
41
if (terminalView is DataProvider ) {
42
42
val controller = terminalView.getData(TerminalPromptController .KEY .name)
@@ -56,9 +56,7 @@ object TerminalUtil {
56
56
}
57
57
58
58
private fun getContent (project : Project ): Content ? {
59
- val toolWindow = ToolWindowManager .getInstance(project)
60
- .getToolWindow(TerminalToolWindowFactory .TOOL_WINDOW_ID )
61
- val content = toolWindow?.contentManager?.selectedContent
62
- return content
59
+ val toolWindow = ToolWindowManager .getInstance(project).getToolWindow(TerminalToolWindowFactory .TOOL_WINDOW_ID )
60
+ return toolWindow?.contentManager?.selectedContent
63
61
}
64
62
}
0 commit comments