mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 04:09:29 +02:00
ui(git-grep): expose regexp mode in dropdown
This commit is contained in:
parent
6d6116857c
commit
663e957d3d
8 changed files with 66 additions and 20 deletions
|
@ -40,11 +40,22 @@ func CodeSearch(ctx *context.Context) {
|
|||
language := ctx.FormTrim("l")
|
||||
keyword := ctx.FormTrim("q")
|
||||
|
||||
isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
|
||||
isFuzzy := true
|
||||
if mode := ctx.FormTrim("mode"); len(mode) > 0 {
|
||||
isFuzzy = mode == "fuzzy"
|
||||
} else {
|
||||
isFuzzy = ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
|
||||
}
|
||||
|
||||
ctx.Data["Keyword"] = keyword
|
||||
ctx.Data["Language"] = language
|
||||
ctx.Data["CodeSearchOptions"] = []string{"exact", "fuzzy"}
|
||||
ctx.Data["IsFuzzy"] = isFuzzy
|
||||
if isFuzzy {
|
||||
ctx.Data["CodeSearchMode"] = "fuzzy"
|
||||
} else {
|
||||
ctx.Data["CodeSearchMode"] = "exact"
|
||||
}
|
||||
ctx.Data["IsCodePage"] = true
|
||||
|
||||
if keyword == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue