Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Auto generate docs
  • Loading branch information
bew authored and github-actions[bot] committed Nov 4, 2025
commit 41a1113c2d6ad2b2a3380659939a04eaf3f1d1e9
12 changes: 6 additions & 6 deletions DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,21 +752,21 @@ ChoiceNodes allow choosing between multiple nodes.

<!-- panvimdoc-ignore-end -->

`c(pos, choices, opts?): LuaSnip.ChoiceNode`: Create a new choiceNode from a list of choices. The
first item in this list is the initial choice, and it can be changed while any node of a choice is
active. So, if all choices should be reachable, every choice has to have a place for the cursor to
stop at.
`c(pos?, choices, node_opts?): LuaSnip.ChoiceNode`: Create a new choiceNode from a list of choices.
The first item in this list is the initial choice, and it can be changed while any node of a choice
is active. So, if all choices should be reachable, every choice has to have a place for the cursor
to stop at.

If the choice is a snippetNode like `sn(nil, {...nodes...})` the given `nodes` have to contain an
`insertNode` (e.g. `i(1)`). Using an `insertNode` or `textNode` directly as a choice is also fine,
the latter is special-cased to have a jump-point at the beginning of its text.

* `pos: integer` Jump-index of the node. (See [Basics-Jump-Index](#jump-index))
* `pos?: integer?` Jump-index of the node. (See [Basics-Jump-Index](#jump-index))
* `choices: (LuaSnip.Node|LuaSnip.Node[])[]` A list of nodes that can be switched between
interactively. If a list of nodes is passed as a choice, it will be turned into a snippetNode.
Jumpable nodes that generally need a jump-index don't need one when used as a choice since they
inherit the choiceNode's jump-index anyway.
* `opts?: LuaSnip.Opts.ChoiceNode?` Additional optional arguments.
* `node_opts?: LuaSnip.Opts.ChoiceNode?` Additional optional arguments.
Valid keys are:

* `restore_cursor?: boolean?` If set, the currently active node is looked up in the switched-to
Expand Down
15 changes: 8 additions & 7 deletions doc/luasnip.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*luasnip.txt* For NeoVim 0.7-0.11 Last change: 2025 November 03
*luasnip.txt* For NeoVim 0.7-0.11 Last change: 2025 November 04

==============================================================================
Table of Contents *luasnip-table-of-contents*
Expand Down Expand Up @@ -772,23 +772,24 @@ ChoiceNodes allow choosing between multiple nodes.
}))
<

`c(pos, choices, opts?): LuaSnip.ChoiceNode`: Create a new choiceNode from a
list of choices. The first item in this list is the initial choice, and it can
be changed while any node of a choice is active. So, if all choices should be
reachable, every choice has to have a place for the cursor to stop at.
`c(pos?, choices, node_opts?): LuaSnip.ChoiceNode`: Create a new choiceNode
from a list of choices. The first item in this list is the initial choice, and
it can be changed while any node of a choice is active. So, if all choices
should be reachable, every choice has to have a place for the cursor to stop
at.

If the choice is a snippetNode like `sn(nil, {...nodes...})` the given `nodes`
have to contain an `insertNode` (e.g. `i(1)`). Using an `insertNode` or
`textNode` directly as a choice is also fine, the latter is special-cased to
have a jump-point at the beginning of its text.

- `pos: integer` Jump-index of the node. (See |luasnip-basics-jump-index|)
- `pos?: integer?` Jump-index of the node. (See |luasnip-basics-jump-index|)
- `choices: (LuaSnip.Node|LuaSnip.Node[])[]` A list of nodes that can be switched
between interactively. If a list of nodes is passed as a choice, it will be
turned into a snippetNode. Jumpable nodes that generally need a jump-index
don’t need one when used as a choice since they inherit the choiceNode’s
jump-index anyway.
- `opts?: LuaSnip.Opts.ChoiceNode?` Additional optional arguments.
- `node_opts?: LuaSnip.Opts.ChoiceNode?` Additional optional arguments.
Valid keys are:
- `restore_cursor?: boolean?` If set, the currently active node is looked up in
the switched-to choice, and the cursor restored to preserve the current
Expand Down