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):
175
175
"""Print `msg` as an error message."""
176
176
return self ._session .request ('vim_err_write' , msg )
177
177
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
+
178
192
179
193
class Current (object ):
180
194
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ def _on_signal(self, signum):
159
159
160
160
def _on_error (self , error ):
161
161
debug (error )
162
- self ._error = Exception (error )
162
+ self ._error = IOError (error )
163
163
self .stop ()
164
164
165
165
def _on_interrupt (self ):
You can’t perform that action at this time.
0 commit comments