mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 16:36:30 +00:00
fix(docs): force blank line after numbered list items #35950
Workaround until the vimdoc parser supports numbered list-items: https://github.com/neovim/tree-sitter-vimdoc/issues/144
This commit is contained in:
@@ -2253,6 +2253,7 @@ To try it out, here is a quickstart example using Copilot: *lsp-copilot*
|
|||||||
1. Install Copilot: >sh
|
1. Install Copilot: >sh
|
||||||
npm install --global @github/copilot-language-server
|
npm install --global @github/copilot-language-server
|
||||||
<
|
<
|
||||||
|
|
||||||
2. Define a config, (or copy `lsp/copilot.lua` from
|
2. Define a config, (or copy `lsp/copilot.lua` from
|
||||||
https://github.com/neovim/nvim-lspconfig): >lua
|
https://github.com/neovim/nvim-lspconfig): >lua
|
||||||
vim.lsp.config('copilot', {
|
vim.lsp.config('copilot', {
|
||||||
@@ -2260,14 +2261,18 @@ To try it out, here is a quickstart example using Copilot: *lsp-copilot*
|
|||||||
root_markers = { '.git' },
|
root_markers = { '.git' },
|
||||||
})
|
})
|
||||||
<
|
<
|
||||||
|
|
||||||
3. Activate the config: >lua
|
3. Activate the config: >lua
|
||||||
vim.lsp.enable('copilot')
|
vim.lsp.enable('copilot')
|
||||||
<
|
<
|
||||||
|
|
||||||
4. Sign in to Copilot, or use the `:LspCopilotSignIn` command from
|
4. Sign in to Copilot, or use the `:LspCopilotSignIn` command from
|
||||||
https://github.com/neovim/nvim-lspconfig
|
https://github.com/neovim/nvim-lspconfig
|
||||||
|
|
||||||
5. Enable inline completion: >lua
|
5. Enable inline completion: >lua
|
||||||
vim.lsp.inline_completion.enable()
|
vim.lsp.inline_completion.enable()
|
||||||
<
|
<
|
||||||
|
|
||||||
6. Set a keymap for `vim.lsp.inline_completion.get()` and invoke the keymap.
|
6. Set a keymap for `vim.lsp.inline_completion.get()` and invoke the keymap.
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2162,6 +2162,7 @@ vim.validate({name}, {value}, {validator}, {optional}, {message})
|
|||||||
-- ...
|
-- ...
|
||||||
end
|
end
|
||||||
<
|
<
|
||||||
|
|
||||||
2. `vim.validate(spec)` (deprecated) where `spec` is of type
|
2. `vim.validate(spec)` (deprecated) where `spec` is of type
|
||||||
`table<string,[value:any, validator: vim.validate.Validator, optional_or_msg? : boolean|string]>)`
|
`table<string,[value:any, validator: vim.validate.Validator, optional_or_msg? : boolean|string]>)`
|
||||||
Validates a argument specification. Specs are evaluated in alphanumeric
|
Validates a argument specification. Specs are evaluated in alphanumeric
|
||||||
@@ -2366,7 +2367,9 @@ vim.filetype.match({args}) *vim.filetype.match()*
|
|||||||
|
|
||||||
The filetype can be detected using one of three methods:
|
The filetype can be detected using one of three methods:
|
||||||
1. Using an existing buffer
|
1. Using an existing buffer
|
||||||
|
|
||||||
2. Using only a file name
|
2. Using only a file name
|
||||||
|
|
||||||
3. Using only file contents
|
3. Using only file contents
|
||||||
|
|
||||||
Of these, option 1 provides the most accurate result as it uses both the
|
Of these, option 1 provides the most accurate result as it uses both the
|
||||||
|
@@ -1706,8 +1706,11 @@ Query:iter_captures({node}, {source}, {start_row}, {end_row}, {opts})
|
|||||||
|
|
||||||
The iterator returns four values:
|
The iterator returns four values:
|
||||||
1. the numeric id identifying the capture
|
1. the numeric id identifying the capture
|
||||||
|
|
||||||
2. the captured node
|
2. the captured node
|
||||||
|
|
||||||
3. metadata from any directives processing the match
|
3. metadata from any directives processing the match
|
||||||
|
|
||||||
4. the match itself
|
4. the match itself
|
||||||
|
|
||||||
Example: how to get captures by name: >lua
|
Example: how to get captures by name: >lua
|
||||||
|
@@ -316,6 +316,10 @@ local function render_md(node, start_indent, indent, text_width, level, is_list)
|
|||||||
elseif contains(ntype, { 'list_marker_minus', 'list_marker_star' }) then
|
elseif contains(ntype, { 'list_marker_minus', 'list_marker_star' }) then
|
||||||
parts[#parts + 1] = '• '
|
parts[#parts + 1] = '• '
|
||||||
elseif ntype == 'list_item' then
|
elseif ntype == 'list_item' then
|
||||||
|
-- HACK(MariaSolOs): Revert this after the vimdoc parser supports numbered list-items (https://github.com/neovim/tree-sitter-vimdoc/issues/144)
|
||||||
|
if (node[1].text or ''):match('[2-9]%.') then
|
||||||
|
parts[#parts + 1] = '\n'
|
||||||
|
end
|
||||||
parts[#parts + 1] = string.rep(' ', indent)
|
parts[#parts + 1] = string.rep(' ', indent)
|
||||||
local offset = node[1].type == 'list_marker_dot' and 3 or 2
|
local offset = node[1].type == 'list_marker_dot' and 3 or 2
|
||||||
for i, child in ipairs(node) do
|
for i, child in ipairs(node) do
|
||||||
|
Reference in New Issue
Block a user