mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-24 16:26:57 +00:00
Don't autosuggest emojis inside injectors
This commit is contained in:
1 parent
cfffb4961b
commit
41d817823b
1 file changed
+4
-4
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user