diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2021-07-23 17:42:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-23 11:42:37 -0400 |
| commit | 79644ab67731c7ba956c354bf0545282f34e10cc (patch) | |
| tree | e65dbf73b3442ab1aa9fc59fc56a35b4c9edf1e0 /lua/tests/manual/auto_picker.lua | |
| parent | 664690029fdb302bee8d3f27a458383e8477add7 (diff) | |
chore: use stylua for formatting (#1040)
* chore: stylua job and config
* reformat with stylua
Diffstat (limited to 'lua/tests/manual/auto_picker.lua')
| -rw-r--r-- | lua/tests/manual/auto_picker.lua | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/lua/tests/manual/auto_picker.lua b/lua/tests/manual/auto_picker.lua index e33edee..5189ba7 100644 --- a/lua/tests/manual/auto_picker.lua +++ b/lua/tests/manual/auto_picker.lua @@ -1,24 +1,24 @@ -RELOAD('telescope') +RELOAD "telescope" -local finders = require('telescope.finders') -local make_entry = require('telescope.make_entry') -local previewers = require('telescope.previewers') -local pickers = require('telescope.pickers') -local sorters = require('telescope.sorters') +local finders = require "telescope.finders" +local make_entry = require "telescope.make_entry" +local previewers = require "telescope.previewers" +local pickers = require "telescope.pickers" +local sorters = require "telescope.sorters" local find_files = function(opts) opts = opts or {} - opts.prompt_prefix = '' + opts.prompt_prefix = "" local find_command = opts.find_command if not find_command then - if 1 == vim.fn.executable("fd") then - find_command = { 'fd', '--type', 'f' } - elseif 1 == vim.fn.executable("fdfind") then - find_command = { 'fdfind', '--type', 'f' } - elseif 1 == vim.fn.executable("rg") then - find_command = { 'rg', '--files' } + if 1 == vim.fn.executable "fd" then + find_command = { "fd", "--type", "f" } + elseif 1 == vim.fn.executable "fdfind" then + find_command = { "fdfind", "--type", "f" } + elseif 1 == vim.fn.executable "rg" then + find_command = { "rg", "--files" } end end @@ -29,11 +29,8 @@ local find_files = function(opts) opts.entry_maker = opts.entry_maker or make_entry.gen_from_file(opts) local p = pickers.new(opts, { - prompt = 'Find Files', - finder = finders.new_oneshot_job( - find_command, - opts - ), + prompt = "Find Files", + finder = finders.new_oneshot_job(find_command, opts), previewer = previewers.cat.new(opts), sorter = sorters.get_fuzzy_file(), @@ -42,21 +39,24 @@ local find_files = function(opts) local count = 0 p:register_completion_callback(function(s) - print(count, vim.inspect(s.stats, { - process = function(item) - if type(item) == 'string' and item:sub(1, 1) == '_' then - return nil - end - - return item - end, - })) + print( + count, + vim.inspect(s.stats, { + process = function(item) + if type(item) == "string" and item:sub(1, 1) == "_" then + return nil + end + + return item + end, + }) + ) count = count + 1 end) local feed = function(text, feed_opts) - feed_opts = feed_opts or 'n' + feed_opts = feed_opts or "n" vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(text, true, false, true), feed_opts, true) end @@ -68,10 +68,10 @@ local find_files = function(opts) end vim.wait(300, function() end) - feed("<CR>", '') + feed("<CR>", "") coroutine.yield() - print("STILL CALLED?") + print "STILL CALLED?" end)) p:find() |
