diff --git a/README.md b/README.md index 0f4f3fe0..e249c39b 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ Note that at the moment the ssh adapter does not support Windows machines, and i - [open_float(dir)](doc/api.md#open_floatdir) - [toggle_float(dir)](doc/api.md#toggle_floatdir) - [open(dir)](doc/api.md#opendir) -- [close()](doc/api.md#close) +- [close(opts)](doc/api.md#closeopts) - [open_preview(opts, callback)](doc/api.md#open_previewopts-callback) - [select(opts, callback)](doc/api.md#selectopts-callback) - [save(opts, cb)](doc/api.md#saveopts-cb) diff --git a/doc/api.md b/doc/api.md index 35c63920..2f51cddc 100644 --- a/doc/api.md +++ b/doc/api.md @@ -13,7 +13,7 @@ - [open_float(dir)](#open_floatdir) - [toggle_float(dir)](#toggle_floatdir) - [open(dir)](#opendir) -- [close()](#close) +- [close(opts)](#closeopts) - [open_preview(opts, callback)](#open_previewopts-callback) - [select(opts, callback)](#selectopts-callback) - [save(opts, cb)](#saveopts-cb) @@ -119,11 +119,15 @@ Open oil browser for a directory | ----- | ------------- | ------------------------------------------------------------------------------------------- | | dir | `nil\|string` | When nil, open the parent of the current buffer, or the cwd if current buffer is not a file | -## close() +## close(opts) -`close()` \ +`close(opts)` \ Restore the buffer that was present when oil was opened +| Param | Type | Desc | +| ----------------- | -------------------- | --------------------------------------------------- | +| opts | `nil\|oil.CloseOpts` | | +| >exit_if_last_buf | `nil\|boolean` | Exit vim if this oil buffer is the last open buffer | ## open_preview(opts, callback) diff --git a/doc/oil.txt b/doc/oil.txt index 48df3a5e..1ee0d116 100644 --- a/doc/oil.txt +++ b/doc/oil.txt @@ -316,9 +316,13 @@ open({dir}) *oil.ope {dir} `nil|string` When nil, open the parent of the current buffer, or the cwd if current buffer is not a file -close() *oil.close* +close({opts}) *oil.close* Restore the buffer that was present when oil was opened + Parameters: + {opts} `nil|oil.CloseOpts` + {exit_if_last_buf} `nil|boolean` Exit vim if this oil buffer is the + last open buffer open_preview({opts}, {callback}) *oil.open_preview* Preview the entry under the cursor in a split @@ -513,6 +517,9 @@ change_sort *actions.change_sor close *actions.close* Close oil and restore original buffer + Parameters: + {exit_if_last_buf} `boolean` Exit vim if oil is closed as the last buffer + open_cmdline *actions.open_cmdline* Open vim cmdline with current entry as an argument