Refresh generated neovim config
This commit is contained in:
@ -102,7 +102,8 @@ local function get_file_snippets(file)
|
||||
|
||||
-- vscode documents `,`, but `.` also works.
|
||||
-- an entry `false` in this list will cause a `ft=nil` for the snippet.
|
||||
local filetypes = parts.scope and vim.split(parts.scope, "[.,]")
|
||||
local filetypes = parts.scope
|
||||
and loader_util.scopestring_to_filetypes(parts.scope)
|
||||
or { false }
|
||||
|
||||
local contexts = {}
|
||||
|
||||
@ -281,6 +281,11 @@ local function normalize_opts(opts)
|
||||
}
|
||||
end
|
||||
|
||||
local function scopestring_to_filetypes(str)
|
||||
local str_trimmed = str:gsub("^%s+", ""):gsub("%s+$", "")
|
||||
return vim.split(str_trimmed, "%s*[.,]%s*")
|
||||
end
|
||||
|
||||
return {
|
||||
filetypelist_to_set = filetypelist_to_set,
|
||||
split_lines = split_lines,
|
||||
@ -296,4 +301,5 @@ return {
|
||||
get_load_fts = get_load_fts,
|
||||
add_file_snippets = add_file_snippets,
|
||||
normalize_opts = normalize_opts,
|
||||
scopestring_to_filetypes = scopestring_to_filetypes,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user