handle fuzzy-matched part in empty auto-complete

This commit is contained in:
LenAnderson
2024-03-31 07:49:48 -04:00
parent 364f802282
commit f4e38c7cd1

View File

@ -2052,6 +2052,9 @@ export function setNewSlashCommandAutoComplete(textarea, isFloating = false) {
case 'fuzzy': {
const matched = name.replace(fuzzyRegex, (_, ...parts)=>{
parts.splice(-2, 2);
if (parts.length == 2) {
return parts.join('');
}
return parts.map((it, idx)=>{
if (it === null || it.length == 0) return '';
if (idx % 2 == 1) {