File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,18 @@ class ScriptView extends MessagePanelView
4747 # Get script view ready
4848 @ clear ()
4949
50- close : ->
50+ removePanel : ->
5151 @ stop ()
5252 @ detach ()
53- super
53+ # the 'close' method from MessagePanelView actually destroys the panel
54+ ScriptView .__super__ .close .apply (this )
55+
56+ # This is triggered when hitting the 'close' button on the panel
57+ # We are not actually closing the panel here since we want to trigger
58+ # 'script:close-view' which will eventually remove the panel via 'removePanel'
59+ close : ->
60+ workspaceView = atom .views .getView (atom .workspace )
61+ atom .commands .dispatch workspaceView, ' script:close-view'
5462
5563 stop : ->
5664 @ display ' stdout' , ' ^C'
Original file line number Diff line number Diff line change @@ -51,14 +51,14 @@ module.exports =
5151
5252 deactivate : ->
5353 @runtime .destroy ()
54- @scriptView .close ()
54+ @scriptView .removePanel ()
5555 @scriptOptionsView .close ()
5656 @subscriptions .dispose ()
5757 GrammarUtils .deleteTempFiles ()
5858
5959 closeScriptViewAndStopRunner : ->
6060 @runtime .stop ()
61- @scriptView .close ()
61+ @scriptView .removePanel ()
6262
6363 # Public
6464 #
You can’t perform that action at this time.
0 commit comments