mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-03 20:57:43 +01:00
no pipe inject in first executor of closure
This commit is contained in:
parent
e4ab5d7d02
commit
c47db9e729
@ -251,6 +251,7 @@ export class SlashCommandClosure {
|
|||||||
}
|
}
|
||||||
async * executeStep() {
|
async * executeStep() {
|
||||||
let done = 0;
|
let done = 0;
|
||||||
|
let isFirst = true;
|
||||||
for (const executor of this.executorList) {
|
for (const executor of this.executorList) {
|
||||||
this.onProgress?.(done, this.commandCount);
|
this.onProgress?.(done, this.commandCount);
|
||||||
this.debugController?.setExecutor(executor);
|
this.debugController?.setExecutor(executor);
|
||||||
@ -259,10 +260,12 @@ export class SlashCommandClosure {
|
|||||||
// no execution for breakpoints, just raise counter
|
// no execution for breakpoints, just raise counter
|
||||||
done++;
|
done++;
|
||||||
yield executor;
|
yield executor;
|
||||||
|
isFirst = false;
|
||||||
} else if (executor instanceof SlashCommandBreak) {
|
} else if (executor instanceof SlashCommandBreak) {
|
||||||
done += this.executorList.length - this.executorList.indexOf(executor);
|
done += this.executorList.length - this.executorList.indexOf(executor);
|
||||||
this.scope.pipe = executor.value ?? this.scope.pipe;
|
this.scope.pipe = executor.value ?? this.scope.pipe;
|
||||||
yield executor;
|
yield executor;
|
||||||
|
isFirst = false;
|
||||||
} else {
|
} else {
|
||||||
/**@type {import('./SlashCommand.js').NamedArguments} */
|
/**@type {import('./SlashCommand.js').NamedArguments} */
|
||||||
let args = {
|
let args = {
|
||||||
@ -302,8 +305,7 @@ export class SlashCommandClosure {
|
|||||||
|
|
||||||
// substitute unnamed argument
|
// substitute unnamed argument
|
||||||
if (executor.unnamedArgumentList.length == 0) {
|
if (executor.unnamedArgumentList.length == 0) {
|
||||||
//TODO no pipe injection on first executor in a closure?
|
if (!isFirst && executor.injectPipe) {
|
||||||
if (executor.injectPipe) {
|
|
||||||
value = this.scope.pipe;
|
value = this.scope.pipe;
|
||||||
args._hasUnnamedArgument = this.scope.pipe !== null && this.scope.pipe !== undefined;
|
args._hasUnnamedArgument = this.scope.pipe !== null && this.scope.pipe !== undefined;
|
||||||
}
|
}
|
||||||
@ -383,6 +385,7 @@ export class SlashCommandClosure {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
yield executor;
|
yield executor;
|
||||||
|
isFirst = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user