Skip to content

Commit

Permalink
chore(build): auto-generate vimdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
astronvimbot committed Sep 27, 2024
1 parent ca2a852 commit ae62807
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
33 changes: 33 additions & 0 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,39 @@ function astrocore.which_key_register()

Register queued which-key mappings

### with_file


```lua
function astrocore.with_file(filename: string, mode?: "a"|"a+"|"a+b"|"ab"|"r"...(+7), callback?: fun(file: file*), on_error?: fun(err: string))
```

Execute function with open file

*param* `filename` — path to file to interact with

*param* `mode` — the mode in which to open the file

*param* `callback` — the callback to execute with the opened file

*param* `on_error` — the callback to execute if unable to open the file

```lua
mode:
-> "r" -- Read mode.
| "w" -- Write mode.
| "a" -- Append mode.
| "r+" -- Update mode, all previous data is preserved.
| "w+" -- Update mode, all previous data is erased.
| "a+" -- Append update mode, previous data is preserved, writing is only allowed at the end of file.
| "rb" -- Read mode. (in binary mode.)
| "wb" -- Write mode. (in binary mode.)
| "ab" -- Append mode. (in binary mode.)
| "r+b" -- Update mode, all previous data is preserved. (in binary mode.)
| "w+b" -- Update mode, all previous data is erased. (in binary mode.)
| "a+b" -- Append update mode, previous data is preserved, writing is only allowed at the end of file. (in binary mode.)
```


## astrocore.buffer

Expand Down
35 changes: 34 additions & 1 deletion doc/astrocore.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*astrocore.txt* For Neovim >= 0.9.0 Last change: 2024 September 19
*astrocore.txt* For Neovim >= 0.9.0 Last change: 2024 September 27

==============================================================================
Table of Contents *astrocore-table-of-contents*
Expand Down Expand Up @@ -656,6 +656,39 @@ WHICH_KEY_REGISTER ~
Register queued which-key mappings


WITH_FILE ~

>lua
function astrocore.with_file(filename: string, mode?: "a"|"a+"|"a+b"|"ab"|"r"...(+7), callback?: fun(file: file*), on_error?: fun(err: string))
<

Execute function with open file

_param_ `filename` — path to file to interact with

_param_ `mode` — the mode in which to open the file

_param_ `callback` — the callback to execute with the opened file

_param_ `on_error` — the callback to execute if unable to open the file

>lua
mode:
-> "r" -- Read mode.
| "w" -- Write mode.
| "a" -- Append mode.
| "r+" -- Update mode, all previous data is preserved.
| "w+" -- Update mode, all previous data is erased.
| "a+" -- Append update mode, previous data is preserved, writing is only allowed at the end of file.
| "rb" -- Read mode. (in binary mode.)
| "wb" -- Write mode. (in binary mode.)
| "ab" -- Append mode. (in binary mode.)
| "r+b" -- Update mode, all previous data is preserved. (in binary mode.)
| "w+b" -- Update mode, all previous data is erased. (in binary mode.)
| "a+b" -- Append update mode, previous data is preserved, writing is only allowed at the end of file. (in binary mode.)
<


ASTROCORE.BUFFER *astrocore-lua-api-astrocore.buffer*


Expand Down

0 comments on commit ae62807

Please sign in to comment.