File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,20 @@ def err_write(self, msg):
175175 """Print `msg` as an error message."""
176176 return self ._session .request ('vim_err_write' , msg )
177177
178+ def quit (self , quit_command = 'qa!' ):
179+ """Send a quit command to Nvim.
180+
181+ By default, the quit command is 'qa!' which will make Nvim quit without
182+ saving anything.
183+ """
184+ try :
185+ self .command (quit_command )
186+ except IOError :
187+ # sending a quit command will raise an IOError because the
188+ # connection is closed before a response is received. Safe to
189+ # ignore it.
190+ pass
191+
178192
179193class Current (object ):
180194
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ def _on_signal(self, signum):
159159
160160 def _on_error (self , error ):
161161 debug (error )
162- self ._error = Exception (error )
162+ self ._error = IOError (error )
163163 self .stop ()
164164
165165 def _on_interrupt (self ):
You can’t perform that action at this time.
0 commit comments