mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
make fuzzy wildcards non-greedy
This commit is contained in:
@ -1982,7 +1982,7 @@ export function setNewSlashCommandAutoComplete(textarea, isFloating = false) {
|
||||
isReplacable = isInput && (!executor ? true : textarea.selectionStart == executor.start - 2 + executor.name.length + 1);
|
||||
|
||||
const matchType = power_user.stscript?.matching ?? 'strict';
|
||||
const fuzzyRegex = new RegExp(`^(.*)${slashCommand.split('').map(char=>`(${escapeRegex(char)})`).join('(.*)')}(.*)$`, 'i');
|
||||
const fuzzyRegex = new RegExp(`^(.*?)${slashCommand.split('').map(char=>`(${escapeRegex(char)})`).join('(.*?)')}(.*?)$`, 'i');
|
||||
const matchers = {
|
||||
'strict': (cmd) => cmd.toLowerCase().startsWith(slashCommand),
|
||||
'includes': (cmd) => cmd.toLowerCase().includes(slashCommand),
|
||||
|
Reference in New Issue
Block a user