mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Search with space #175
This commit is contained in:
@@ -59,9 +59,9 @@ object SearchHelper {
|
||||
&& !searchInfo.containsOnlyNullValues()) {
|
||||
// If search provide results
|
||||
database.createVirtualGroupFromSearchInfo(
|
||||
searchInfo.toString(),
|
||||
searchInfo.isASearchByDomain(),
|
||||
MAX_SEARCH_ENTRY
|
||||
searchInfoString = searchInfo.toString(),
|
||||
searchInfoByDomain = searchInfo.isASearchByDomain(),
|
||||
max = MAX_SEARCH_ENTRY
|
||||
)?.let { searchGroup ->
|
||||
if (searchGroup.numberOfChildEntries > 0) {
|
||||
searchWithoutUI = true
|
||||
|
||||
@@ -151,7 +151,7 @@ class SearchHelper {
|
||||
if (searchParameters.searchByDomain) {
|
||||
try {
|
||||
stringToCheck.inTheSameDomainAs(word, sameSubDomain = true)
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
false
|
||||
}
|
||||
} else null
|
||||
@@ -204,11 +204,19 @@ class SearchHelper {
|
||||
regex.matches(stringToCheck)
|
||||
} else {
|
||||
specialComparison?.invoke(stringToCheck, searchParameters.searchQuery)
|
||||
?: stringToCheck.contains(
|
||||
searchParameters.searchQuery,
|
||||
?: run {
|
||||
// Search with space separator #175
|
||||
var searchFound = true
|
||||
searchParameters.searchQuery.split(" ").forEach { word ->
|
||||
searchFound = searchFound
|
||||
&& stringToCheck.contains(
|
||||
word,
|
||||
!searchParameters.caseSensitive
|
||||
)
|
||||
}
|
||||
searchFound
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user