aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2024-05-15 01:18:33 +0200
committerGitHub <noreply@github.com>2024-05-15 07:18:33 +0800
commit7acf39ddab8ebdb63ebf78ec980149d20783fd4b (patch)
tree90bd4d1b3aa6b9c8e340a3f825651eb3ac47071e /runtime/doc/lua.txt
parentb83d5fabc6cbe08867b933958de7df7d3917247b (diff)
downloadrneovim-7acf39ddab8ebdb63ebf78ec980149d20783fd4b.tar.gz
rneovim-7acf39ddab8ebdb63ebf78ec980149d20783fd4b.tar.bz2
rneovim-7acf39ddab8ebdb63ebf78ec980149d20783fd4b.zip
docs: misc (#28609)
Closes https://github.com/neovim/neovim/issues/28484. Closes https://github.com/neovim/neovim/issues/28719. Co-authored-by: Chris <crwebb85@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Jake B <16889000+jakethedev@users.noreply.github.com> Co-authored-by: Jonathan Raines <jonathan.s.raines@gmail.com> Co-authored-by: Yi Ming <ofseed@foxmail.com> Co-authored-by: Zane Dufour <zane@znd4.me> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r--runtime/doc/lua.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index e24f5dfc7e..f227420c75 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2673,7 +2673,6 @@ vim.filetype.add({filetypes}) *vim.filetype.add()*
vim.filetype.add {
pattern = {
['.*'] = {
- priority = -math.huge,
function(path, bufnr)
local content = vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1] or ''
if vim.regex([[^#!.*\\<mine\\>]]):match_str(content) ~= nil then
@@ -2682,6 +2681,7 @@ vim.filetype.add({filetypes}) *vim.filetype.add()*
return 'drawing'
end
end,
+ { priority = -math.huge },
},
},
}
@@ -4005,7 +4005,8 @@ Iter:fold({init}, {f}) *Iter:fold()*
-- Get the "maximum" item of an iterable.
vim.iter({ -99, -4, 3, 42, 0, 0, 7 })
:fold({}, function(acc, v)
- acc.max = math.max(v, acc.max or v) return acc
+ acc.max = math.max(v, acc.max or v)
+ return acc
end) --> { max = 42 }
<
@@ -4346,7 +4347,7 @@ vim.snippet.jump({direction}) *vim.snippet.jump()*
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
+ if vim.snippet.active({ direction = 1 }) then
return '<cmd>lua vim.snippet.jump(1)<cr>'
else
return '<Tab>'