mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-16 02:45:09 +00:00
[WIP]: Tue 15 Sep 2020 04:54:27 PM EDT
This commit is contained in:
+41
-12
@@ -1,15 +1,44 @@
|
||||
local uv = require('luv')
|
||||
local uv = vim.loop
|
||||
|
||||
-- print(vim.inspect(uv))
|
||||
ThreadsAvailable = {}
|
||||
|
||||
local work = vim.loop.new_work(function(path, prompt, line)
|
||||
package.path = path
|
||||
local had_to_load = false
|
||||
|
||||
local uv = require('luv')
|
||||
if not fuzzy_sorter then
|
||||
had_to_load = true
|
||||
fuzzy_sorter = require('telescope.sorters').get_fuzzy_file()
|
||||
end
|
||||
|
||||
-- return fuzzy_sorter:score(prompt, line), had_to_load, uv.hrtime(), tostring(uv.thread_self())
|
||||
return tostring(uv.thread_self())
|
||||
end, function(thread_string)
|
||||
-- print(vim.inspect(vim.split(x, ';')))
|
||||
ThreadsAvailable[thread_string] = true
|
||||
end)
|
||||
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
work:queue(package.path, "hello", "hello world")
|
||||
|
||||
|
||||
local my_table = {}
|
||||
local my_value = 1
|
||||
|
||||
local table_adder = uv.new_thread(function(tbl)
|
||||
table.insert(tbl, "HELLO")
|
||||
end, my_table)
|
||||
|
||||
uv.thread_join(table_adder)
|
||||
-- print(vim.inspect(MY_TABLE))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user