diff options
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/shared.lua | 8 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/health.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/language.lua | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua index 884929e33a..9e337e93e8 100644 --- a/runtime/lua/vim/shared.lua +++ b/runtime/lua/vim/shared.lua @@ -796,13 +796,15 @@ end --- a.b.c = 1 --- </pre> --- ----@param create function|nil The function called to create a missing value. +---@param create function?(key:any):any The function called to create a missing value. ---@return table Empty table with metamethod function vim.defaulttable(create) - create = create or vim.defaulttable + create = create or function(_) + return vim.defaulttable() + end return setmetatable({}, { __index = function(tbl, key) - rawset(tbl, key, create()) + rawset(tbl, key, create(key)) return rawget(tbl, key) end, }) diff --git a/runtime/lua/vim/treesitter/health.lua b/runtime/lua/vim/treesitter/health.lua index fd1188fde4..dabf2cdf6c 100644 --- a/runtime/lua/vim/treesitter/health.lua +++ b/runtime/lua/vim/treesitter/health.lua @@ -22,7 +22,7 @@ function M.check() ) ) else - local lang = ts.language.inspect_language(parsername) + local lang = ts.language.inspect(parsername) health.report_ok( string.format('Parser: %-10s ABI: %d, path: %s', parsername, lang._abi_version, parser) ) diff --git a/runtime/lua/vim/treesitter/language.lua b/runtime/lua/vim/treesitter/language.lua index b1c788e6ba..5b74bb6200 100644 --- a/runtime/lua/vim/treesitter/language.lua +++ b/runtime/lua/vim/treesitter/language.lua @@ -4,7 +4,9 @@ local a = vim.api local M = {} ---@type table<string,string> -local ft_to_lang = {} +local ft_to_lang = { + help = 'vimdoc', +} --- Get the filetypes associated with the parser named {lang}. --- @param lang string Name of parser |