0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 00:12:56 +00:00

Don't autosuggest emojis inside injectors

This commit is contained in:
Trevor Buckner
2024-05-07 15:30:56 -04:00
parent cfffb4961b
commit 41d817823b

View File

@@ -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;