advanced syntaxes (VAR{}): ignore quotes around variable name

This commit is contained in:
bordun 2021-05-08 16:17:43 +02:00
parent 41ff331235
commit c1669cd03d
2 changed files with 8 additions and 1 deletions

View file

@ -4,7 +4,8 @@
- bug fixes
- issue when resizing widget using keyboard shortcuts
- advanced syntaxes (VAR{}): avoid storing default value as string if it can be parsed as a javascript primitive (boolean, number, etc)
- advanced syntaxes (VAR{}): avoid storing default value as string if it can be parsed as a javascript primitive (boolean, number, etc)
- advanced syntaxes (VAR{}): ignore quotes around variable name
- editor
- change keyboard shortcuts for moving widgets (now `mod + arrows`) and navigating in widgets (now `arrows`) to feel more natural with the project tree view.

View file

@ -644,6 +644,12 @@ class Widget extends EventEmitter {
} catch (err) {}
}
if (
// remove quotes
(name[0] === '"' && name[name.length - 1] === '"') ||
(name[0] === '\'' && name[name.length - 1] === '\'') ||
) name = name.slice(1, name.length - 1)
if (!this.variables[name]) {
this.variables[name] = {default: value, value: value, propNames: [propName]}