Skip to content

Commit

Permalink
chore(build): auto-generate vimdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 4, 2023
1 parent 8651582 commit 9828a5d
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 20 deletions.
103 changes: 93 additions & 10 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,6 @@ function astrocore.buffer.close_tab()

Close the current tab

### comparator


```lua
table
```

A table of buffer comparator functions

### current_buf


Expand Down Expand Up @@ -539,13 +530,105 @@ function astrocore.buffer.sort(compare_func: string|function, skip_autocmd: bool

Sort a the buffers in the current tab based on some comparator

*param* `compare_func` — a string of a comparator defined in require("astrocore.buffer").comparator or a custom comparator function
*param* `compare_func` — a string of a comparator defined in require("astrocore.buffer.comparator") or a custom comparator function

*param* `skip_autocmd` — whether or not to skip triggering AstroBufsUpdated autocmd event

*return* — Whether or not the buffers were sorted


## astrocore.buffer.comparator

AstroNvim Buffer Comparators

Buffer comparator functions for sorting buffers

This module can be loaded with `local buffer_comparators = require "astrocore.buffer.comparator"`

copyright 2023
license GNU General Public License v3.0

### bufnr


```lua
function astrocore.buffer.comparator.bufnr(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
```

Comparator of two buffer numbers

*param* `bufnr_a` — buffer number A

*param* `bufnr_b` — buffer number B

*return* `comparison` — true if A is sorted before B, false if B should be sorted before A

### extension


```lua
function astrocore.buffer.comparator.extension(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
```

Comparator of two buffer numbers based on the file extensions

*param* `bufnr_a` — buffer number A

*param* `bufnr_b` — buffer number B

*return* `comparison` — true if A is sorted before B, false if B should be sorted before A

### full_path


```lua
function astrocore.buffer.comparator.full_path(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
```

Comparator of two buffer numbers based on the full path

*param* `bufnr_a` — buffer number A

*param* `bufnr_b` — buffer number B

*return* `comparison` — true if A is sorted before B, false if B should be sorted before A

### modified


```lua
function astrocore.buffer.comparator.modified(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
```

Comparator of two buffers based on modification date

*param* `bufnr_a` — buffer number A

*param* `bufnr_b` — buffer number B

*return* `comparison` — true if A is sorted before B, false if B should be sorted before A

### unique_path


```lua
function astrocore.buffer.comparator.unique_path(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
```

Comparator of two buffers based on their unique path

*param* `bufnr_a` — buffer number A

*param* `bufnr_b` — buffer number B

*return* `comparison` — true if A is sorted before B, false if B should be sorted before A


## astrocore.mason

Mason Utilities
Expand Down
109 changes: 99 additions & 10 deletions doc/astrocore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Table of Contents *astrocore-table-of-contents*
2. Lua API |astrocore-lua-api|
- astrocore |astrocore-lua-api-astrocore|
- astrocore.buffer |astrocore-lua-api-astrocore.buffer|
- astrocore.buffer.comparator|astrocore-lua-api-astrocore.buffer.comparator|
- astrocore.mason |astrocore-lua-api-astrocore.mason|
- astrocore.toggles |astrocore-lua-api-astrocore.toggles|

Expand Down Expand Up @@ -456,15 +457,6 @@ CLOSE_TAB ~
Close the current tab


COMPARATOR ~

>lua
table
<

A table of buffer comparator functions


CURRENT_BUF ~

>lua
Expand Down Expand Up @@ -582,14 +574,111 @@ SORT ~
Sort a the buffers in the current tab based on some comparator

_param_ `compare_func` — a string of a comparator defined in
require("astrocore.buffer").comparator or a custom comparator function
require("astrocore.buffer.comparator") or a custom comparator function

_param_ `skip_autocmd` — whether or not to skip triggering AstroBufsUpdated
autocmd event

_return_ — Whether or not the buffers were sorted


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

AstroNvim Buffer Comparators

Buffer comparator functions for sorting buffers

This module can be loaded with `local buffer_comparators = require
"astrocore.buffer.comparator"`

copyright 2023 license GNU General Public License v3.0


BUFNR ~

>lua
function astrocore.buffer.comparator.bufnr(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
<

Comparator of two buffer numbers

_param_ `bufnr_a` — buffer number A

_param_ `bufnr_b` — buffer number B

_return_ `comparison` — true if A is sorted before B, false if B should be
sorted before A


EXTENSION ~

>lua
function astrocore.buffer.comparator.extension(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
<

Comparator of two buffer numbers based on the file extensions

_param_ `bufnr_a` — buffer number A

_param_ `bufnr_b` — buffer number B

_return_ `comparison` — true if A is sorted before B, false if B should be
sorted before A


FULL_PATH ~

>lua
function astrocore.buffer.comparator.full_path(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
<

Comparator of two buffer numbers based on the full path

_param_ `bufnr_a` — buffer number A

_param_ `bufnr_b` — buffer number B

_return_ `comparison` — true if A is sorted before B, false if B should be
sorted before A


MODIFIED ~

>lua
function astrocore.buffer.comparator.modified(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
<

Comparator of two buffers based on modification date

_param_ `bufnr_a` — buffer number A

_param_ `bufnr_b` — buffer number B

_return_ `comparison` — true if A is sorted before B, false if B should be
sorted before A


UNIQUE_PATH ~

>lua
function astrocore.buffer.comparator.unique_path(bufnr_a: integer, bufnr_b: integer)
-> comparison: boolean
<

Comparator of two buffers based on their unique path

_param_ `bufnr_a` — buffer number A

_param_ `bufnr_b` — buffer number B

_return_ `comparison` — true if A is sorted before B, false if B should be
sorted before A


ASTROCORE.MASON *astrocore-lua-api-astrocore.mason*

Mason Utilities
Expand Down

0 comments on commit 9828a5d

Please sign in to comment.