Skip to content

Commit

Permalink
fixes streetcomplete#547 : Auto-complete not working for tree names w…
Browse files Browse the repository at this point in the history
…ith whitespace (streetcomplete#565)
  • Loading branch information
ravenfeld authored Jul 5, 2024
1 parent 0b333ce commit fae19b2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ class AddTreeGenusForm : AbstractOsmQuestForm<Tree>() {
}
return trees.filter { tree ->
tree.toDisplayString() == search
|| tree.name == search
|| tree.name.split(" ").any { it.startsWith(search, true) }
|| tree.localName?.contains(search, true) == true
//sorting: genus-only first, then prefer trees with localName
|| tree.toDisplayString().startsWith(search, true)
|| tree.name == search
|| tree.name.split(" ").any { it.startsWith(search, true) }
|| tree.localName?.contains(search, true) == true
//sorting: genus-only first, then prefer trees with localName
}.sortedBy { it.localName == null }.sortedBy { it.isSpecies }
}

Expand Down

0 comments on commit fae19b2

Please sign in to comment.