on master help sign in
Add patch for C# syntax
commit47a37218900d9a40d7704973c015eef7bee3024a authorsharkdp <davidpeter@web.de> dateSat 11 Apr 2020, 22:50 (7 years ago) parent495fab2
3 files changed+29−6
assets/create.sh+16−6 assets/patches/C#.sublime-syntax.patch+13 assets/JavaDoc.sublime-syntax.patch → assets/patches/JavaDoc.sublime-syntax.patch
assets/create.sh+16−6
@@ -42,12 +42,22 @@ fi
4242# Always remove the local cache to avoid any confusion
4343bat cache --clear
4444
45−# TODO: Remove this (and the reverse part below) when
46−# https://github.com/trishume/syntect/issues/222 has been fixed
47−JAVADOC_FILE="${ASSET_DIR}/syntaxes/01_Packages/Java/JavaDoc.sublime-syntax"
48−JAVADOC_PATCH="${ASSET_DIR}/JavaDoc.sublime-syntax.patch"
49−patch "$JAVADOC_FILE" "$JAVADOC_PATCH"
45+# TODO:
46+# - Remove the JavaDoc patch once https://github.com/trishume/syntect/issues/222 has been fixed
47+# - Remove the C# patch once https://github.com/sublimehq/Packages/pull/2331 has been merged
48+
49+(
50+ cd "$ASSET_DIR"
51+ for patch in patches/*.patch; do
52+ patch --strip=0 < "$patch"
53+ done
54+)
5055
5156bat cache --build --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
5257
53−patch -R "$JAVADOC_FILE" "$JAVADOC_PATCH"
58+(
59+ cd "$ASSET_DIR"
60+ for patch in patches/*.patch; do
61+ patch --strip=0 --reverse < "$patch"
62+ done
63+)
assets/patches/C#.sublime-syntax.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git syntaxes/01_Packages/C#/C#.sublime-syntax syntaxes/01_Packages/C#/C#.sublime-syntax
2+index ed494f8b..01b710e8 100644
3+--- syntaxes/01_Packages/C#/C#.sublime-syntax
4++++ syntaxes/01_Packages/C#/C#.sublime-syntax
5+@@ -1312,7 +1312,7 @@ contexts:
6+ 2: punctuation.separator.cs
7+ 3: punctuation.section.brackets.end.cs
8+ 4: keyword.operator.pointer.cs
9+- - match: \((?=(?:[^,)(]*|\([^\)]*\))*,)
10++ - match: \((?=(?:[^,)(]|\([^\)]*\))*,)
11+ scope: punctuation.section.group.begin.cs
12+ push:
13+ - meta_scope: meta.group.tuple.cs
assets/JavaDoc.sublime-syntax.patch → assets/patches/JavaDoc.sublime-syntax.patchrenamed

The content is the same.