mirror of
https://github.com/neovim/neovim.git
synced 2026-01-29 16:40:59 +10:00
fix(lsp): redundant vim.snippet.jumpable #28560
This commit is contained in:
committed by
GitHub
parent
a1c9da2d5a
commit
bc7f86209d
@@ -4306,8 +4306,33 @@ Iter:totable() *Iter:totable()*
|
||||
==============================================================================
|
||||
Lua module: vim.snippet *vim.snippet*
|
||||
|
||||
vim.snippet.active() *vim.snippet.active()*
|
||||
Returns `true` if there's an active snippet in the current buffer.
|
||||
*vim.snippet.ActiveFilter*
|
||||
|
||||
Fields: ~
|
||||
• {direction} (`vim.snippet.Direction`) Navigation direction. -1 for
|
||||
previous, 1 for next.
|
||||
|
||||
|
||||
vim.snippet.active({filter}) *vim.snippet.active()*
|
||||
Returns `true` if there's an active snippet in the current buffer,
|
||||
applying the given filter if provided.
|
||||
|
||||
You can use this function to navigate a snippet as follows: >lua
|
||||
vim.keymap.set({ 'i', 's' }, '<Tab>', function()
|
||||
if vim.snippet.active({ direction = 1 }) then
|
||||
return '<cmd>lua vim.snippet.jump(1)<cr>'
|
||||
else
|
||||
return '<Tab>'
|
||||
end
|
||||
end, { expr = true })
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {filter} (`vim.snippet.ActiveFilter?`) Filter to constrain the search
|
||||
with:
|
||||
• `direction` (vim.snippet.Direction): Navigation direction.
|
||||
Will return `true` if the snippet can be jumped in the
|
||||
given direction. See |vim.snippet.ActiveFilter|.
|
||||
|
||||
Return: ~
|
||||
(`boolean`)
|
||||
@@ -4343,26 +4368,6 @@ vim.snippet.jump({direction}) *vim.snippet.jump()*
|
||||
• {direction} (`vim.snippet.Direction`) Navigation direction. -1 for
|
||||
previous, 1 for next.
|
||||
|
||||
vim.snippet.jumpable({direction}) *vim.snippet.jumpable()*
|
||||
Returns `true` if there is an active snippet which can be jumped in the
|
||||
given direction. You can use this function to navigate a snippet as
|
||||
follows: >lua
|
||||
vim.keymap.set({ 'i', 's' }, '<Tab>', function()
|
||||
if vim.snippet.jumpable(1) then
|
||||
return '<cmd>lua vim.snippet.jump(1)<cr>'
|
||||
else
|
||||
return '<Tab>'
|
||||
end
|
||||
end, { expr = true })
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {direction} (`vim.snippet.Direction`) Navigation direction. -1 for
|
||||
previous, 1 for next.
|
||||
|
||||
Return: ~
|
||||
(`boolean`)
|
||||
|
||||
|
||||
==============================================================================
|
||||
Lua module: vim.text *vim.text*
|
||||
|
||||
Reference in New Issue
Block a user