From 41d817823be66f0d8c72f0d919692657054ae4ca Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 7 May 2024 15:30:56 -0400 Subject: [PATCH] Don't autosuggest emojis inside injectors --- shared/naturalcrit/codeEditor/autocompleteEmoji.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/naturalcrit/codeEditor/autocompleteEmoji.js b/shared/naturalcrit/codeEditor/autocompleteEmoji.js index 2719526ae..66881e81e 100644 --- a/shared/naturalcrit/codeEditor/autocompleteEmoji.js +++ b/shared/naturalcrit/codeEditor/autocompleteEmoji.js @@ -61,10 +61,10 @@ const showAutocompleteEmoji = function(CodeMirror, editor) { // Get the text from the start of the line to the cursor const textToCursor = line.slice(0, cursor.ch); - // Do not autosuggest emojis in curly span/div properties - if(line.includes('{{')) { - const curlyToCursor = textToCursor.slice(textToCursor.indexOf(`{{`)); - const curlySpanRegex = /{{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\1$/g; + // Do not autosuggest emojis in curly span/div/injector properties + if(line.includes('{')) { + const curlyToCursor = textToCursor.slice(textToCursor.indexOf(`{`)); + const curlySpanRegex = /{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\1$/g; if (regex.test(curlyToCursor)) return;