Skip to content

Commit

Permalink
chore(docs): autogenerate vimdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy authored and github-actions[bot] committed Dec 30, 2024
1 parent 20c802a commit a41fdaf
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions doc/flatten.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FEATURES *flatten.nvim-features*
- Open files from terminal buffers without creating a nested session
- Allow blocking for git commits
- Configuration
- Callbacks/hooks for user-specific workflows
- Hooks for user-specific workflows
- Open in vsplit, split, tab, current window, or alternate window
- Pipe from terminal into a new Neovim buffer
- Setting to force blocking from the commandline, regardless of filetype
Expand Down Expand Up @@ -123,15 +123,15 @@ Flatten comes with the following defaults:
local flatten = require("flatten")

local config = {
callbacks = {
should_block = flatten.callbacks.should_block,
should_nest = flatten.callbacks.should_nest,
pre_open = flatten.callbacks.pre_open,
post_open = flatten.callbacks.post_open,
block_end = flatten.callbacks.block_end,
no_files = flatten.callbacks.no_files,
guest_data = flatten.callbacks.guest_data,
pipe_path = flatten.callbacks.pipe_path,
hooks = {
should_block = flatten.hooks.should_block,
should_nest = flatten.hooks.should_nest,
pre_open = flatten.hooks.pre_open,
post_open = flatten.hooks.post_open,
block_end = flatten.hooks.block_end,
no_files = flatten.hooks.no_files,
guest_data = flatten.hooks.guest_data,
pipe_path = flatten.hooks.pipe_path,
},
block_for = {
gitcommit = true,
Expand Down Expand Up @@ -213,22 +213,22 @@ WINDOW ~
- The default is `"first"`.


CALLBACKS ~
HOOKS ~

Defaults are in `flatten.callbacks`.
Defaults are in `flatten.hooks`.

- `callbacks.should_block``fun(argv: string[]): boolean`
- `hooks.should_block``fun(argv: string[]): boolean`
- Should return `true` if the guest should wait for the host to close the file.
- `callbacks.should_nest``fun(host: channel): boolean`
- `hooks.should_nest``fun(host: channel): boolean`
- Should return `true` if the guest should _not_ be flattened into the same Neovim instance as the host.
This is useful for customizing when files should be sent to a host instance and when they should be opened
in a new one.
- `callbacks.pre_open``fun(opts: Flatten.PreOpenContext)`
- `hooks.pre_open``fun(opts: Flatten.PreOpenContext)`
- Called before opening files.
- `Flatten.PreOpenContext`
- `data``any`
- The data passed to the host from the `guest_data` callback.
- `callbacks.post_open``fun(opts: Flatten.PostOpenContext)`
- `hooks.post_open``fun(opts: Flatten.PostOpenContext)`
- Called after opening files.
- `Flatten.PostOpenContext`
- `bufnr``integer`
Expand All @@ -243,21 +243,21 @@ Defaults are in `flatten.callbacks`.
- Whether the files were opened in diff mode.
- `data``any`
- The data passed to the host from the `guest_data` callback.
- `callbacks.block_end``fun(opts: Flatten.BlockEndContext)`
- `hooks.block_end``fun(opts: Flatten.BlockEndContext)`
- Called when the host closes the file.
- `Flatten.BlockEndContext`
- `filetype``string`
- The filetype of the file that was opened.
- `data``any`
- The data passed to the host from the `guest_data` callback.
- `callbacks.no_files``fun(opts: Flatten.NoFilesArgs): Flatten.NoFilesBehavior`
- `hooks.no_files``fun(opts: Flatten.NoFilesArgs): Flatten.NoFilesBehavior`
- Called when no files are passed to a guest instance, to determine what to do.
- `Flatten.NoFilesArgs`
- `argv``string[]`
- `Flatten.NoFilesBehavior``boolean` | `{ nest: boolean, block: boolean }`
- `callbacks.guest_data``fun(): any`
- `hooks.guest_data``fun(): any`
- Called when the guest sends data to the host, to allow custom data to be passed to the host.
- `callbacks.pipe_path``fun(): string`
- `hooks.pipe_path``fun(): string`
- Called to determine whether an instance is a host or is a guest and should connect to a host.


Expand Down Expand Up @@ -296,7 +296,7 @@ git commit buffer on write:
window = {
open = "alternate",
},
callbacks = {
hooks = {
should_block = function(argv)
-- Note that argv contains all the parts of the CLI command, including
-- Neovim's path, commands, options and files.
Expand Down

0 comments on commit a41fdaf

Please sign in to comment.