mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-29 19:52:54 +01:00
Fix dialog and invalid variable style
This commit is contained in:
1 parent
c4ab2965f7
commit
20e1b5c00e
4 files changed
+99
-87
No files matched your search
@@ -106,20 +106,19 @@ function templateTags(
|
||||
};
|
||||
}
|
||||
|
||||
let invalid = false;
|
||||
if (option.type === 'function') {
|
||||
const tokens = parseTemplate(rawTag);
|
||||
const values = collectArgumentValues(tokens, option);
|
||||
for (const arg of option.args) {
|
||||
if (!('optional' in arg)) continue;
|
||||
if (!arg.optional && values[arg.name] == null) {
|
||||
invalid = true;
|
||||
option.invalid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const widget = new TemplateTagWidget({ ...option, invalid }, rawTag, node.from);
|
||||
const widget = new TemplateTagWidget(option, rawTag, node.from);
|
||||
const deco = Decoration.replace({ widget, inclusive: true });
|
||||
widgets.push(deco.range(node.from, node.to));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user