mirror of https://github.com/rivo/tview.git
Merge pull request #974 from Egor3f/patch-1
Fix: FindItems returned wrong indices if mustContainBoth is false
This commit is contained in:
commit
c766eefb38
2
list.go
2
list.go
|
@ -447,7 +447,7 @@ func (l *List) FindItems(mainSearch, secondarySearch string, mustContainBoth, ig
|
||||||
mainContained := strings.Contains(mainText, mainSearch)
|
mainContained := strings.Contains(mainText, mainSearch)
|
||||||
secondaryContained := strings.Contains(secondaryText, secondarySearch)
|
secondaryContained := strings.Contains(secondaryText, secondarySearch)
|
||||||
if mustContainBoth && mainContained && secondaryContained ||
|
if mustContainBoth && mainContained && secondaryContained ||
|
||||||
!mustContainBoth && (mainText != "" && mainContained || secondaryText != "" && secondaryContained) {
|
!mustContainBoth && (mainSearch != "" && mainContained || secondarySearch != "" && secondaryContained) {
|
||||||
indices = append(indices, index)
|
indices = append(indices, index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue