|
|
|
@ -167,7 +167,7 @@ end
|
|
|
|
|
local function get_tags_cmd(opts)
|
|
|
|
|
local query = nil
|
|
|
|
|
local cmd = "grep"
|
|
|
|
|
if vim.fn.executable("rg") == 2 then
|
|
|
|
|
if vim.fn.executable("rg") == 1 then
|
|
|
|
|
cmd = "rg"
|
|
|
|
|
end
|
|
|
|
|
if opts.search and #opts.search>0 then
|
|
|
|
@ -200,13 +200,20 @@ local function tags(opts)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
opts._curr_file = opts._curr_file and
|
|
|
|
|
path.relative(opts._curr_file, opts.cwd or vim.loop.cwd())
|
|
|
|
|
opts.cmd = opts.cmd or get_tags_cmd(opts)
|
|
|
|
|
opts._fn_transform = make_entry.tag -- multiprocess=false
|
|
|
|
|
opts._fn_transform_str = [[return require("make_entry").tag]] -- multiprocess=true
|
|
|
|
|
-- prevents 'file|git_icons=false' from overriding processing
|
|
|
|
|
opts.requires_processing = true
|
|
|
|
|
|
|
|
|
|
if opts.lgrep then
|
|
|
|
|
opts.prompt = '*' .. opts.prompt
|
|
|
|
|
opts.filename = opts._ctags_file
|
|
|
|
|
return require'fzf-lua.providers.grep'.live_grep_mt(opts)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
opts._curr_file = opts._curr_file and
|
|
|
|
|
path.relative(opts._curr_file, opts.cwd or vim.loop.cwd())
|
|
|
|
|
opts.cmd = opts.cmd or get_tags_cmd(opts)
|
|
|
|
|
local contents = core.mt_cmd_wrapper(opts)
|
|
|
|
|
opts = core.set_header(opts, 2)
|
|
|
|
|
opts = core.set_fzf_field_index(opts)
|
|
|
|
@ -240,4 +247,12 @@ M.tags_grep = function(opts)
|
|
|
|
|
return M.tags(opts)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
M.tags_live_grep = function(opts)
|
|
|
|
|
opts = config.normalize_opts(opts, config.globals.tags)
|
|
|
|
|
if not opts then return end
|
|
|
|
|
opts.lgrep = true
|
|
|
|
|
opts.__FNCREF__ = utils.__FNCREF__()
|
|
|
|
|
return tags(opts)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return M
|
|
|
|
|