fix: quit after mutations when :wq or similar (#221)

This commit is contained in:
Steven Arcangeli 2023-11-13 10:36:28 -08:00
parent 3727410e48
commit af13ce333f
6 changed files with 65 additions and 18 deletions

View file

@ -15,7 +15,7 @@
- [open(dir)](#opendir)
- [close()](#close)
- [select(opts, callback)](#selectopts-callback)
- [save(opts)](#saveopts)
- [save(opts, cb)](#saveopts-cb)
- [setup(opts)](#setupopts)
<!-- /TOC -->
@ -132,15 +132,21 @@ Select the entry under the cursor
| | close | `boolean` | Close the original oil buffer once selection is made |
| callback | `nil\|fun(err: nil\|string)` | Called once all entries have been opened | |
## save(opts)
## save(opts, cb)
`save(opts)` \
`save(opts, cb)` \
Save all changes
| Param | Type | Desc | |
| ----- | ------------ | -------------- | ------------------------------------------------------------------------------------------- |
| opts | `nil\|table` | | |
| | confirm | `nil\|boolean` | Show confirmation when true, never when false, respect skip_confirm_for_simple_edits if nil |
| Param | Type | Desc | |
| ----- | ---------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------- |
| opts | `nil\|table` | | |
| | confirm | `nil\|boolean` | Show confirmation when true, never when false, respect skip_confirm_for_simple_edits if nil |
| cb | `nil\|fun(err: nil\|string)` | Called when mutations complete. | |
**Note:**
<pre>
If you provide your own callback function, there will be no notification for errors.
</pre>
## setup(opts)

View file

@ -238,13 +238,17 @@ select({opts}, {callback}) *oil.selec
{callback} `nil|fun(err: nil|string)` Called once all entries have been
opened
save({opts}) *oil.save*
save({opts}, {cb}) *oil.save*
Save all changes
Parameters:
{opts} `nil|table`
{confirm} `nil|boolean` Show confirmation when true, never when false,
respect skip_confirm_for_simple_edits if nil
{cb} `nil|fun(err: nil|string)` Called when mutations complete.
Note:
If you provide your own callback function, there will be no notification for errors.
setup({opts}) *oil.setup*
Initialize oil