feat: sound autocomplete matches anywhere in name using includes()

This commit is contained in:
drdozer
2025-09-11 21:37:35 +01:00
parent ed182d4b3f
commit cd659ac2a1
+1 -1
View File
@@ -155,7 +155,7 @@ function soundHandler(context) {
const fragment = fragMatch ? fragMatch[1] : inside;
if (!fragment || fragment.length === 0) return null;
const soundNames = Object.keys(soundMap.get()).sort();
const filteredSounds = soundNames.filter((name) => name.startsWith(fragment));
const filteredSounds = soundNames.filter((name) => name.includes(fragment));
let options = filteredSounds.map((name) => ({ label: name, type: 'sound' }));
const from = soundContext.to - fragment.length;
return {