mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
chore!: remove compat module for vim.ui
This commit is contained in:
parent
bca65c068b
commit
21ac88b955
1 changed files with 0 additions and 23 deletions
|
|
@ -237,29 +237,6 @@ local function config_info(process_function)
|
|||
print(vim.inspect(config, { process = process_function }))
|
||||
end
|
||||
|
||||
if not vim.ui then
|
||||
vim.ui = {
|
||||
select = function(items, opts, on_choice)
|
||||
vim.validate {
|
||||
items = { items, "table", false },
|
||||
on_choice = { on_choice, "function", false },
|
||||
}
|
||||
opts = opts or {}
|
||||
local choices = { opts.prompt or "Select one of:" }
|
||||
local format_item = opts.format_item or tostring
|
||||
for i, item in pairs(items) do
|
||||
table.insert(choices, string.format("%d: %s", i, format_item(item)))
|
||||
end
|
||||
local choice = vim.fn.inputlist(choices)
|
||||
if choice < 1 or choice > #items then
|
||||
on_choice(nil, nil)
|
||||
else
|
||||
on_choice(items[choice], choice)
|
||||
end
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
function M.edit_query_file(query_group, lang)
|
||||
lang = lang or parsers.get_buf_lang()
|
||||
local files = ts_query.get_query_files(lang, query_group, true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue