diff --git a/README.md b/README.md index 71f83a4..85a5615 100644 --- a/README.md +++ b/README.md @@ -278,7 +278,7 @@ Note that at the moment the ssh adapter does not support Windows machines, and i - [toggle_float(dir)](doc/api.md#toggle_floatdir) - [open(dir)](doc/api.md#opendir) - [close()](doc/api.md#close) -- [select(opts)](doc/api.md#selectopts) +- [select(opts, callback)](doc/api.md#selectopts-callback) - [save(opts)](doc/api.md#saveopts) - [setup(opts)](doc/api.md#setupopts) diff --git a/doc/api.md b/doc/api.md index 8d9d87a..f87c34e 100644 --- a/doc/api.md +++ b/doc/api.md @@ -13,7 +13,7 @@ - [toggle_float(dir)](#toggle_floatdir) - [open(dir)](#opendir) - [close()](#close) -- [select(opts)](#selectopts) +- [select(opts, callback)](#selectopts-callback) - [save(opts)](#saveopts) - [setup(opts)](#setupopts) @@ -106,20 +106,21 @@ Open oil browser for a directory Restore the buffer that was present when oil was opened -## select(opts) +## select(opts, callback) -`select(opts)` \ +`select(opts, callback)` \ Select the entry under the cursor -| Param | Type | Desc | | -| ----- | ------------ | -------------------------------------------------- | ---------------------------------------------------- | -| opts | `nil\|table` | | | -| | vertical | `boolean` | Open the buffer in a vertical split | -| | horizontal | `boolean` | Open the buffer in a horizontal split | -| | split | `"aboveleft"\|"belowright"\|"topleft"\|"botright"` | Split modifier | -| | preview | `boolean` | Open the buffer in a preview window | -| | tab | `boolean` | Open the buffer in a new tab | -| | close | `boolean` | Close the original oil buffer once selection is made | +| Param | Type | Desc | | +| -------- | ---------------------------- | -------------------------------------------------- | ---------------------------------------------------- | +| opts | `nil\|table` | | | +| | vertical | `boolean` | Open the buffer in a vertical split | +| | horizontal | `boolean` | Open the buffer in a horizontal split | +| | split | `"aboveleft"\|"belowright"\|"topleft"\|"botright"` | Split modifier | +| | preview | `boolean` | Open the buffer in a preview window | +| | tab | `boolean` | Open the buffer in a new tab | +| | 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) diff --git a/doc/oil.txt b/doc/oil.txt index d960a47..6b54838 100644 --- a/doc/oil.txt +++ b/doc/oil.txt @@ -200,11 +200,11 @@ close() *oil.clos Restore the buffer that was present when oil was opened -select({opts}) *oil.select* +select({opts}, {callback}) *oil.select* Select the entry under the cursor Parameters: - {opts} `nil|table` + {opts} `nil|table` {vertical} `boolean` Open the buffer in a vertical split {horizontal} `boolean` Open the buffer in a horizontal split {split} `"aboveleft"|"belowright"|"topleft"|"botright"` Split @@ -213,6 +213,8 @@ select({opts}) *oil.selec {tab} `boolean` Open the buffer in a new tab {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}) *oil.save* Save all changes