44__author__ = "Christian Schirm"
55__copyright__ = "Copyright 2018"
66__license__ = "GPLv3"
7- __version__ = "0.8 "
7+ __version__ = "1.0 "
88
99import Npp
1010from Npp import editor , console , notepad
@@ -111,6 +111,7 @@ def clearCallbacks(self):
111111 editor .clearCallbacks ([Npp .SCINTILLANOTIFICATION .DWELLSTART ])
112112 editor .clearCallbacks ([Npp .SCINTILLANOTIFICATION .MODIFIED ])
113113 notepad .clearCallbacks ([Npp .NOTIFICATION .BUFFERACTIVATED ])
114+ notepad .clearCallbacks ([Npp .NOTIFICATION .SHUTDOWN ])
114115 if self .lexer :
115116 notepad .clearCallbacks ([Npp .SCINTILLANOTIFICATION .UPDATEUI ])
116117 notepad .clearCallbacks ([Npp .NOTIFICATION .LANGCHANGED ])
@@ -123,6 +124,8 @@ def setCallbacks(self):
123124 editor .callback (self .onMouseDwell , [Npp .SCINTILLANOTIFICATION .DWELLSTART ])
124125 editor .callback (self .textModified , [Npp .SCINTILLANOTIFICATION .MODIFIED ])
125126 notepad .callback (self .onBufferActivated , [Npp .NOTIFICATION .BUFFERACTIVATED ])
127+ notepad .callback (self .onShutdown , [Npp .NOTIFICATION .SHUTDOWN ])
128+
126129 if self .lexer :
127130 editor .callbackSync (self .lexer .on_updateui , [Npp .SCINTILLANOTIFICATION .UPDATEUI ])
128131 notepad .callback (self .lexer .on_langchanged , [Npp .NOTIFICATION .LANGCHANGED ])
@@ -133,6 +136,10 @@ def __del__(self):
133136 except : pass
134137 self .clearCallbacks ()
135138
139+ def onShutdown (self , args ):
140+ try : self .interp .proc .terminate ()
141+ except : pass
142+
136143 def restartKernel (self ):
137144 if self .externalPython :
138145 bufferID = self .bufferBusy
0 commit comments