Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: Fix multiline expression (#4297)

Ivan Starkov23375517677c
diff --git a/apps/builder/app/builder/shared/expression-editor.tsx b/apps/builder/app/builder/shared/expression-editor.tsx
index b522c86132..0a6e25c2fa 100644
--- a/apps/builder/app/builder/shared/expression-editor.tsx
+++ b/apps/builder/app/builder/shared/expression-editor.tsx
@@ -268,8 +268,6 @@ const variableMatcher = new MatchDecorator({
regexp: /(\$ws\$dataSource\$\w+)/g,
decorate: (add, from, _to, match, view) => {
- const startPos = match.index;
-
const name = match[1];
const [{ aliases }] = view.state.facet(VariablesData);
@@ -282,7 +280,8 @@ const variableMatcher = new MatchDecorator({
if (dataSourceId === undefined) {
return;
}
- const endPos = startPos + dataSourceId.length;
+
+ const endPos = from + dataSourceId.length;
add(
from,