fix: better relative path output in live_grep and grep_string (#683)
This commit is contained in:
@@ -49,7 +49,15 @@ files.live_grep = function(opts)
|
|||||||
|
|
||||||
prompt = escape_chars(prompt)
|
prompt = escape_chars(prompt)
|
||||||
|
|
||||||
return flatten { vimgrep_arguments, prompt, opts.search_dirs or '.' }
|
local args = flatten { vimgrep_arguments, prompt }
|
||||||
|
|
||||||
|
if search_dirs then
|
||||||
|
table.insert(args, search_dirs)
|
||||||
|
elseif os_sep == '\\' then
|
||||||
|
table.insert(args, '.')
|
||||||
|
end
|
||||||
|
|
||||||
|
return args
|
||||||
end,
|
end,
|
||||||
opts.entry_maker or make_entry.gen_from_vimgrep(opts),
|
opts.entry_maker or make_entry.gen_from_vimgrep(opts),
|
||||||
opts.max_results,
|
opts.max_results,
|
||||||
@@ -82,17 +90,21 @@ files.grep_string = function(opts)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local args = flatten {
|
||||||
|
vimgrep_arguments,
|
||||||
|
word_match,
|
||||||
|
search,
|
||||||
|
}
|
||||||
|
|
||||||
|
if search_dirs then
|
||||||
|
table.insert(args, search_dirs)
|
||||||
|
elseif os_sep == '\\' then
|
||||||
|
table.insert(args, '.')
|
||||||
|
end
|
||||||
|
|
||||||
pickers.new(opts, {
|
pickers.new(opts, {
|
||||||
prompt_title = 'Find Word',
|
prompt_title = 'Find Word',
|
||||||
finder = finders.new_oneshot_job(
|
finder = finders.new_oneshot_job(args, opts),
|
||||||
flatten {
|
|
||||||
vimgrep_arguments,
|
|
||||||
word_match,
|
|
||||||
search,
|
|
||||||
search_dirs or "."
|
|
||||||
},
|
|
||||||
opts
|
|
||||||
),
|
|
||||||
previewer = conf.grep_previewer(opts),
|
previewer = conf.grep_previewer(opts),
|
||||||
sorter = conf.generic_sorter(opts),
|
sorter = conf.generic_sorter(opts),
|
||||||
}):find()
|
}):find()
|
||||||
|
|||||||
Reference in New Issue
Block a user