scratch: add thoughts
This commit is contained in:
10
scratch/diag_test.lua
Normal file
10
scratch/diag_test.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
local y = function() end
|
||||||
|
|
||||||
|
local x = function()
|
||||||
|
asdf
|
||||||
|
print(y)
|
||||||
|
end
|
||||||
|
|
||||||
|
x()
|
||||||
|
|
||||||
|
y()
|
||||||
33
scratch/piped_to_fzf.lua
Normal file
33
scratch/piped_to_fzf.lua
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
RELOAD('telescope')
|
||||||
|
RELOAD('plenary')
|
||||||
|
|
||||||
|
local finders = require('telescope.finders')
|
||||||
|
local make_entry = require('telescope.make_entry')
|
||||||
|
local pickers = require('telescope.pickers')
|
||||||
|
local sorters = require('telescope.sorters')
|
||||||
|
|
||||||
|
local Job = require('plenary.job')
|
||||||
|
|
||||||
|
pickers.new {
|
||||||
|
prompt = "Piped FZF",
|
||||||
|
|
||||||
|
finder = finders._new {
|
||||||
|
fn_command = function(_, prompt)
|
||||||
|
return {
|
||||||
|
command = 'fzf',
|
||||||
|
args = {'--no-sort', '--filter', prompt or ''},
|
||||||
|
|
||||||
|
writer = Job:new {
|
||||||
|
command = 'rg',
|
||||||
|
args = {'--files'},
|
||||||
|
cwd = '/home/tj/',
|
||||||
|
|
||||||
|
enable_handlers = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
|
entry_maker = make_entry.gen_from_file(),
|
||||||
|
sorter = sorters.get_fuzzy_file(),
|
||||||
|
},
|
||||||
|
}:find()
|
||||||
15
scratch/threaded_lua.lua
Normal file
15
scratch/threaded_lua.lua
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
local uv = require('luv')
|
||||||
|
|
||||||
|
-- print(vim.inspect(uv))
|
||||||
|
|
||||||
|
|
||||||
|
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