summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-04-11 22:50:02 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2020-04-11 23:55:27 +0200
commit47a37218900d9a40d7704973c015eef7bee3024a (patch)
tree28b10ed312b202607c20958d63c7080959961b52
parent495fab24a57b75b0b773acb708164950221d3800 (diff)
Add patch for C# syntax
-rwxr-xr-xassets/create.sh22
-rw-r--r--assets/patches/C#.sublime-syntax.patch13
-rw-r--r--assets/patches/JavaDoc.sublime-syntax.patch (renamed from assets/JavaDoc.sublime-syntax.patch)0
3 files changed, 29 insertions, 6 deletions
diff --git a/assets/create.sh b/assets/create.sh
index 3fb63ebf..1a639649 100755
--- a/assets/create.sh
+++ b/assets/create.sh
@@ -42,12 +42,22 @@ fi
# Always remove the local cache to avoid any confusion
bat cache --clear
-# TODO: Remove this (and the reverse part below) when
-# https://github.com/trishume/syntect/issues/222 has been fixed
-JAVADOC_FILE="${ASSET_DIR}/syntaxes/01_Packages/Java/JavaDoc.sublime-syntax"
-JAVADOC_PATCH="${ASSET_DIR}/JavaDoc.sublime-syntax.patch"
-patch "$JAVADOC_FILE" "$JAVADOC_PATCH"
+# TODO:
+# - Remove the JavaDoc patch once https://github.com/trishume/syntect/issues/222 has been fixed
+# - Remove the C# patch once https://github.com/sublimehq/Packages/pull/2331 has been merged
+
+(
+ cd "$ASSET_DIR"
+ for patch in patches/*.patch; do
+ patch --strip=0 < "$patch"
+ done
+)
bat cache --build --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
-patch -R "$JAVADOC_FILE" "$JAVADOC_PATCH"
+(
+ cd "$ASSET_DIR"
+ for patch in patches/*.patch; do
+ patch --strip=0 --reverse < "$patch"
+ done
+)
diff --git a/assets/patches/C#.sublime-syntax.patch b/assets/patches/C#.sublime-syntax.patch
new file mode 100644
index 00000000..d1c3a1bd
--- /dev/null
+++ b/assets/patches/C#.sublime-syntax.patch
@@ -0,0 +1,13 @@
+diff --git syntaxes/01_Packages/C#/C#.sublime-syntax syntaxes/01_Packages/C#/C#.sublime-syntax
+index ed494f8b..01b710e8 100644
+--- syntaxes/01_Packages/C#/C#.sublime-syntax
++++ syntaxes/01_Packages/C#/C#.sublime-syntax
+@@ -1312,7 +1312,7 @@ contexts:
+ 2: punctuation.separator.cs
+ 3: punctuation.section.brackets.end.cs
+ 4: keyword.operator.pointer.cs
+- - match: \((?=(?:[^,)(]*|\([^\)]*\))*,)
++ - match: \((?=(?:[^,)(]|\([^\)]*\))*,)
+ scope: punctuation.section.group.begin.cs
+ push:
+ - meta_scope: meta.group.tuple.cs
diff --git a/assets/JavaDoc.sublime-syntax.patch b/assets/patches/JavaDoc.sublime-syntax.patch
index 62ee742e..62ee742e 100644
--- a/assets/JavaDoc.sublime-syntax.patch
+++ b/assets/patches/JavaDoc.sublime-syntax.patch