mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Bump github.com/sahilm/fuzzy from 0.1.0 to 0.1.1
Bumps [github.com/sahilm/fuzzy](https://github.com/sahilm/fuzzy) from 0.1.0 to 0.1.1. - [Release notes](https://github.com/sahilm/fuzzy/releases) - [Commits](https://github.com/sahilm/fuzzy/compare/v0.1.0...v0.1.1) --- updated-dependencies: - dependency-name: github.com/sahilm/fuzzy dependency-version: 0.1.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
f12a77ca81
commit
7d6c151296
2
go.mod
2
go.mod
|
|
@ -27,7 +27,7 @@ require (
|
|||
github.com/mgutz/str v1.2.0
|
||||
github.com/mitchellh/go-ps v1.0.0
|
||||
github.com/rivo/uniseg v0.4.7
|
||||
github.com/sahilm/fuzzy v0.1.0
|
||||
github.com/sahilm/fuzzy v0.1.1
|
||||
github.com/samber/lo v1.31.0
|
||||
github.com/sanity-io/litter v1.5.8
|
||||
github.com/sasha-s/go-deadlock v0.3.6
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -103,8 +103,8 @@ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc
|
|||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI=
|
||||
github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
|
||||
github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA=
|
||||
github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
|
||||
github.com/samber/lo v1.31.0 h1:Sfa+/064Tdo4SvlohQUQzBhgSer9v/coGvKQI/XLWAM=
|
||||
github.com/samber/lo v1.31.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8=
|
||||
github.com/sanity-io/litter v1.5.8 h1:uM/2lKrWdGbRXDrIq08Lh9XtVYoeGtcQxk9rtQ7+rYg=
|
||||
|
|
|
|||
3
vendor/github.com/sahilm/fuzzy/.travis.yml
generated
vendored
3
vendor/github.com/sahilm/fuzzy/.travis.yml
generated
vendored
|
|
@ -1,3 +1,6 @@
|
|||
arch:
|
||||
- amd64
|
||||
- ppc64le
|
||||
language: go
|
||||
go:
|
||||
- 1.x
|
||||
|
|
|
|||
8
vendor/github.com/sahilm/fuzzy/README.md
generated
vendored
8
vendor/github.com/sahilm/fuzzy/README.md
generated
vendored
|
|
@ -17,7 +17,7 @@ VSCode, IntelliJ IDEA et al. This library is external dependency-free. It only d
|
|||
|
||||
- Speed. Matches are returned in milliseconds. It's perfect for interactive search boxes.
|
||||
|
||||
- The positions of matches is returned. Allows you to highlight matching characters.
|
||||
- The positions of matches are returned. Allows you to highlight matching characters.
|
||||
|
||||
- Unicode aware.
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ func contains(needle int, haystack []int) bool {
|
|||
return false
|
||||
}
|
||||
```
|
||||
If the data you want to match isn't a slice of strings, you can use `FindFromSource` by implementing
|
||||
If the data you want to match isn't a slice of strings, you can use `FindFrom` by implementing
|
||||
the provided `Source` interface. Here's an example:
|
||||
|
||||
```go
|
||||
|
|
@ -119,7 +119,9 @@ func main() {
|
|||
},
|
||||
}
|
||||
results := fuzzy.FindFrom("al", emps)
|
||||
fmt.Println(results)
|
||||
for _, r := range results {
|
||||
fmt.Println(emps[r.Index])
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
21
vendor/github.com/sahilm/fuzzy/fuzzy.go
generated
vendored
21
vendor/github.com/sahilm/fuzzy/fuzzy.go
generated
vendored
|
|
@ -76,16 +76,36 @@ The following types of matches apply a bonus:
|
|||
|
||||
Penalties are applied for every character in the search string that wasn't matched and all leading
|
||||
characters upto the first match.
|
||||
|
||||
Results are sorted by best match.
|
||||
*/
|
||||
func Find(pattern string, data []string) Matches {
|
||||
return FindFrom(pattern, stringSource(data))
|
||||
}
|
||||
|
||||
/*
|
||||
FindNoSort is an alternative Find implementation that does not sort
|
||||
the results in the end.
|
||||
*/
|
||||
func FindNoSort(pattern string, data []string) Matches {
|
||||
return FindFromNoSort(pattern, stringSource(data))
|
||||
}
|
||||
|
||||
/*
|
||||
FindFrom is an alternative implementation of Find using a Source
|
||||
instead of a list of strings.
|
||||
*/
|
||||
func FindFrom(pattern string, data Source) Matches {
|
||||
matches := FindFromNoSort(pattern, data)
|
||||
sort.Stable(matches)
|
||||
return matches
|
||||
}
|
||||
|
||||
/*
|
||||
FindFromNoSort is an alternative FindFrom implementation that does
|
||||
not sort results in the end.
|
||||
*/
|
||||
func FindFromNoSort(pattern string, data Source) Matches {
|
||||
if len(pattern) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -181,7 +201,6 @@ func FindFrom(pattern string, data Source) Matches {
|
|||
matchedIndexes = match.MatchedIndexes[:0] // Recycle match index slice
|
||||
}
|
||||
}
|
||||
sort.Stable(matches)
|
||||
return matches
|
||||
}
|
||||
|
||||
|
|
|
|||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
|
|
@ -156,7 +156,7 @@ github.com/pmezard/go-difflib/difflib
|
|||
github.com/rivo/uniseg
|
||||
# github.com/rogpeppe/go-internal v1.14.1
|
||||
## explicit; go 1.23
|
||||
# github.com/sahilm/fuzzy v0.1.0
|
||||
# github.com/sahilm/fuzzy v0.1.1
|
||||
## explicit
|
||||
github.com/sahilm/fuzzy
|
||||
# github.com/samber/lo v1.31.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue