Ignore autocomplete errors, regex bug fix
This commit is contained in:
parent
3bc8f2405b
commit
1ba9890227
1 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@ function search(arr, search) {
|
|||
if (!search.length) return false;
|
||||
|
||||
var matches = arr.filter(function (str) {
|
||||
const regex = new RegExp(search, "i");
|
||||
const regex = new RegExp(search.split().join("\\"), "i");
|
||||
return str.search(regex) > -1;
|
||||
});
|
||||
|
||||
|
@ -37,7 +37,7 @@ export default class Autocomplete {
|
|||
})
|
||||
.slice(0, 24),
|
||||
},
|
||||
});
|
||||
}).catch((_) => _);
|
||||
} else {
|
||||
const keys = getAllMods.all().map((_) => _.name);
|
||||
let choices = search(keys, entry);
|
||||
|
@ -52,7 +52,7 @@ export default class Autocomplete {
|
|||
})
|
||||
.slice(0, 24),
|
||||
},
|
||||
});
|
||||
}).catch((_) => _);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue