feat: add loading text for large projects
Large projects can take a long time for the initial scan. This adds some loading text until the initial selection has completed. This will also now schedule the work to collect and sort the candidates to ensure the UI is rendered before with work begins and creates a hanging user experience.
This commit is contained in:
parent
4e174d65f8
commit
8ac1035d8a
1 changed files with 8 additions and 2 deletions
|
|
@ -11,17 +11,23 @@ controller.run = function(items, callback)
|
|||
controller.items = items
|
||||
|
||||
window.initialize()
|
||||
window.set_items { "-- Loading ---" }
|
||||
|
||||
controller.input ""
|
||||
end
|
||||
|
||||
controller.input = function(char)
|
||||
prompt.input(char)
|
||||
window.set_items(controller.items(prompt.text()))
|
||||
vim.schedule(function()
|
||||
window.set_items(controller.items(prompt.text()))
|
||||
end)
|
||||
end
|
||||
|
||||
controller.search = function(value)
|
||||
prompt.set(value)
|
||||
window.set_items(controller.items(prompt.text()))
|
||||
vim.schedule(function()
|
||||
window.set_items(controller.items(prompt.text()))
|
||||
end)
|
||||
end
|
||||
|
||||
controller.complete = function()
|
||||
|
|
|
|||
Loading…
Reference in a new issue