neovim: format telescope.lua
This commit is contained in:
@@ -55,44 +55,44 @@ vim.ui.select = function(items, opts, on_choice)
|
|||||||
on_choice = vim.schedule_wrap(on_choice)
|
on_choice = vim.schedule_wrap(on_choice)
|
||||||
|
|
||||||
pickers
|
pickers
|
||||||
.new({
|
.new({
|
||||||
prompt_title = prompt,
|
prompt_title = prompt,
|
||||||
finder = finders.new_table({
|
finder = finders.new_table({
|
||||||
results = items,
|
results = items,
|
||||||
entry_maker = function(entry)
|
entry_maker = function(entry)
|
||||||
local format_item = opts.format_item or function(item)
|
local format_item = opts.format_item or function(item)
|
||||||
return item
|
return item
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
value = entry,
|
value = entry,
|
||||||
display = format_item(entry),
|
display = format_item(entry),
|
||||||
ordinal = format_item(entry),
|
ordinal = format_item(entry),
|
||||||
}
|
}
|
||||||
end,
|
|
||||||
}),
|
|
||||||
attach_mappings = function(prompt_bufnr)
|
|
||||||
actions.select_default:replace(function()
|
|
||||||
local selection = action_state.get_selected_entry()
|
|
||||||
actions.close(prompt_bufnr)
|
|
||||||
if selection == nil then
|
|
||||||
on_choice(nil, nil)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
on_choice(selection.value, selection.index)
|
|
||||||
end)
|
|
||||||
|
|
||||||
actions.close:enhance({
|
|
||||||
post = function()
|
|
||||||
on_choice(nil, nil)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
return true
|
|
||||||
end,
|
end,
|
||||||
sorter = conf.generic_sorter(),
|
}),
|
||||||
})
|
attach_mappings = function(prompt_bufnr)
|
||||||
:find()
|
actions.select_default:replace(function()
|
||||||
|
local selection = action_state.get_selected_entry()
|
||||||
|
actions.close(prompt_bufnr)
|
||||||
|
if selection == nil then
|
||||||
|
on_choice(nil, nil)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
on_choice(selection.value, selection.index)
|
||||||
|
end)
|
||||||
|
|
||||||
|
actions.close:enhance({
|
||||||
|
post = function()
|
||||||
|
on_choice(nil, nil)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
sorter = conf.generic_sorter(),
|
||||||
|
})
|
||||||
|
:find()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>f", builtin.find_files)
|
vim.keymap.set("n", "<leader>f", builtin.find_files)
|
||||||
|
|||||||
Reference in New Issue
Block a user