ui(git-grep): expose regexp mode in dropdown

This commit is contained in:
Shiny Nematoda 2024-08-16 13:23:25 +00:00 committed by Radosław Piliszek
parent 6d6116857c
commit 663e957d3d
8 changed files with 66 additions and 20 deletions

View file

@ -82,12 +82,12 @@ func GrepSearch(ctx context.Context, repo *Repository, search string, opts GrepO
var results []*GrepResult
// -I skips binary files
cmd := NewCommand(ctx, "grep",
"-I", "--null", "--break", "--heading", "--column",
"-I", "--null", "--break", "--heading",
"--line-number", "--ignore-case", "--full-name")
if opts.Mode == RegExpGrepMode {
cmd.AddArguments("--perl-regexp")
} else {
cmd.AddArguments("--fixed-strings")
cmd.AddArguments("--fixed-strings", "--column")
}
cmd.AddOptionValues("--context", fmt.Sprint(opts.ContextLineNumber))
cmd.AddOptionValues("--max-count", fmt.Sprint(opts.MatchesPerFile))