From 0e94caafcbfd5103cd551d43fdb4d7a4c5f6621c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 14 Mar 2024 14:10:37 +0000 Subject: [PATCH] Update snippet insertion to not insert parenthesis --- packages/builder/src/components/common/CodeEditor/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/common/CodeEditor/index.js b/packages/builder/src/components/common/CodeEditor/index.js index b93c95b944..f66c84adce 100644 --- a/packages/builder/src/components/common/CodeEditor/index.js +++ b/packages/builder/src/components/common/CodeEditor/index.js @@ -271,13 +271,12 @@ export const insertBinding = (view, from, to, text, mode) => { } export const insertSnippet = (view, from, to, text) => { - const parsedInsert = `${text}()` - let cursorPos = from + parsedInsert.length - 1 + let cursorPos = from + text.length view.dispatch({ changes: { from, to, - insert: parsedInsert, + insert: text, }, selection: { anchor: cursorPos,