mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
Merge pull request #707 from peco/fix-fuzzy-slice-literals
Use var declarations for appended-to slices
This commit is contained in:
commit
be9d23d9ac
|
|
@ -58,7 +58,7 @@ func (ff *Fuzzy) applyInternal(ctx context.Context, lines []line.Line, emit func
|
|||
fuzzyQuery := strings.Join(posTerms, "")
|
||||
|
||||
hasUpper := util.ContainsUpper(fuzzyQuery)
|
||||
matched := []fuzzyMatchedItem{}
|
||||
var matched []fuzzyMatchedItem
|
||||
|
||||
LINE:
|
||||
for i, l := range lines {
|
||||
|
|
@ -93,7 +93,7 @@ LINE:
|
|||
|
||||
// Find the index of the first valid rune in the input line
|
||||
txt = l.DisplayString()
|
||||
firstRuneOffsets := []int{}
|
||||
var firstRuneOffsets []int
|
||||
accum := 0
|
||||
var r rune
|
||||
var n int
|
||||
|
|
@ -120,14 +120,14 @@ LINE:
|
|||
}
|
||||
|
||||
// Find all candidate matches
|
||||
candidates := []fuzzyMatchedItem{}
|
||||
var candidates []fuzzyMatchedItem
|
||||
|
||||
OUTER:
|
||||
for _, offset := range firstRuneOffsets {
|
||||
query := fuzzyQuery
|
||||
txt = l.DisplayString()[offset:]
|
||||
base := offset
|
||||
matches := [][]int{}
|
||||
var matches [][]int
|
||||
|
||||
for len(query) > 0 {
|
||||
query, r, n = popRune(query)
|
||||
|
|
|
|||
Loading…
Reference in a new issue