[QOL] Search Ignore Symbols (#2079)
* autofocus implementation * fuzzy match schematic search implementation * enter to select first schematic implementation * fix duplicate variable fix setting check * no fuzzy match * Update SchematicsDialog.java useless t.update * fix no schematic match
This commit is contained in:
@@ -71,17 +71,20 @@ public class SchematicsDialog extends BaseDialog{
|
|||||||
rebuildPane[0] = () -> {
|
rebuildPane[0] = () -> {
|
||||||
t.clear();
|
t.clear();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
String regex = "[`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?]";
|
||||||
|
String searchString = search.toLowerCase().replaceAll(regex," ");
|
||||||
|
|
||||||
if(!schematics.all().contains(s -> search.isEmpty() || s.name().toLowerCase().contains(search.toLowerCase()))){
|
if(!schematics.all().contains(s -> search.isEmpty() || s.name().toLowerCase().replaceAll(regex," ").contains(searchString))){
|
||||||
t.add("$none");
|
t.add("$none");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
firstSchematic = null;
|
firstSchematic = null;
|
||||||
|
|
||||||
for(Schematic s : schematics.all()){
|
for(Schematic s : schematics.all()){
|
||||||
if(!search.isEmpty() && !s.name().toLowerCase().contains(search.toLowerCase())) continue;
|
|
||||||
if(firstSchematic == null)
|
if(!search.isEmpty() && !s.name().toLowerCase().replaceAll(regex," ").contains(searchString)) continue;
|
||||||
firstSchematic = s;
|
if(firstSchematic == null) firstSchematic = s;
|
||||||
|
|
||||||
Button[] sel = {null};
|
Button[] sel = {null};
|
||||||
sel[0] = t.button(b -> {
|
sel[0] = t.button(b -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user