Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions app/src/cc/arduino/contributions/ui/FilterJTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,14 @@ private void spawnTimer() {
}

public void applyFilter() {
String filter = showingHint ? "" : getText();
filter = filter.toLowerCase();

// Replace anything but 0-9, a-z, or : with a space
filter = filter.replaceAll("[^\\x30-\\x39^\\x61-\\x7a^\\x3a]", " ");

onFilter(filter.split(" "));
if (!showingHint) {
String filter = getText().toLowerCase();

// Replace anything but 0-9, a-z, or : with a space
filter = filter.replaceAll("[^\\x30-\\x39^\\x61-\\x7a^\\x3a]", " ");

onFilter(filter.split(" "));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said in the other comment this method should be called with an empty array if showingHint is false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the note, I have addressed the above and pushed the changes.

}
}

protected void onFilter(String[] strings) {
Expand Down