Skip to content

Commit 4cc921d

Browse files
committed
Hack fix for syntax highlighting issue (#26)
1 parent 237a016 commit 4cc921d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

web/mta_highlighting/generate-lua-tmlanguage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async function generateTmLanguage() {
5858

5959
if (allKeywords.length > 0) {
6060
patterns.push({
61-
match: `\\b(${allKeywords.join('|')})\\b(?!\\s*(=|,|;|\\(|\\[|\\)))`,
61+
match: `\\b(${allKeywords.join('|')})\\b(?!\\s*(=|;|\\(|\\[|\\)|,(?!\u200B)))`,
6262
name: 'keyword.mta',
6363
});
6464
}

web/src/utils/functions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ function buildSyntaxString(
110110
parameters: Parameter[],
111111
returns: ReturnBlock | null,
112112
): string {
113+
const ZERO_WIDTH_SPACE = '\u200B';
114+
113115
const returnString = returns
114-
? `${returns.values.map(v => v.type).join(', ')}`
116+
? `${returns.values.map(v => v.type).join(`,${ZERO_WIDTH_SPACE} `)}`
115117
: '';
116118

117119
const requiredParams = parameters.filter(p => p.default === undefined);

0 commit comments

Comments
 (0)