1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 03:00:06 +08:00

feat(flygrep): add lua flygrep

This commit is contained in:
wsdjeg 2022-10-04 21:25:05 +08:00
parent 65347eb2dc
commit 3538fb4a77

View File

@ -1,6 +1,46 @@
local flygrep = {} local flygrep = {}
local logger = require('spacevim.logger').derive('flygrep')
-- the job functions
local jobstart = vim.fn.jobstart
local jobsend = vim.fn.jobsend
local jobstop = vim.fn.jobstop
local timer_start = vim.fn.timer_start
local timer_stop = vim.fn.timer_stop
local jobid = -1
local grep_cmd = {}
-- The available options are:
-- - input: string, the default input pattern
-- - files: a list of string or `@buffers`
-- - cmd: list
-- - opt: list
-- - ropt: list
-- - ignore_case: boolean
-- - smart_case: boolean
-- - expr_opt:
function flygrep.open(opt) function flygrep.open(opt)
end end
local function flygrep(t)
jobid = jobstart(grep_cmd, {
on_stdout = flygrep_stdout,
})
end
function flygrep_stdout(id, data, event)
end
return flygrep