]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/git-commit.yaml
Merge branch 'python-highlight-zero' of https://github.com/a11ce/micro into a11ce...
[micro.git] / runtime / syntax / git-commit.yaml
index dffec546abc452f9f4bb9616eb08ed5eb5a97acd..9f8ef0d9dfb077d6037bd0ff35d606b1d559693f 100644 (file)
@@ -1,20 +1,36 @@
 filetype: git-commit
 
-detect: 
-    filename: "COMMIT_EDITMSG|TAG_EDITMSG"
+detect:
+    filename: "^(.*[\\/])?(COMMIT_EDITMSG|TAG_EDITMSG)$"
 
 rules:
-    - ignore: ".*"
-    - comment: "^#.*"
-    - statement: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*"
-    - statement: "#[[:space:]]deleted:"
-    - statement: "#[[:space:]]modified:"
-    - statement: "#[[:space:]]new file:"
-    - statement: "#[[:space:]]renamed:"
-    - error: "^#       [^/?*:;{}\\\\]+\\.[^/?*:;{}\\\\]+$"
-    - statement: "^#[[:space:]]Changes.*[:]"
-    - statement: "^#[[:space:]]Your branch and '[^']+"
-    - statement: "^#[[:space:]]Your branch and '"
-    - statement: "^#[[:space:]]On branch [^ ]+"
-    - statement: "^#[[:space:]]On branch"
-    - special: "#"
+    # File changes
+    - type.keyword: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*"
+    - type.keyword: "#[[:space:]]deleted:"
+    - type.keyword: "#[[:space:]]modified:"
+    - type.keyword: "#[[:space:]]new file:"
+    - type.keyword: "#[[:space:]]renamed:"
+    - type.keyword: "^#[[:space:]]Changes.*[:]"
+    - type.keyword: "^#[[:space:]]Your branch and '[^']+"
+    - type.keyword: "^#[[:space:]]Your branch and '"
+    - type.keyword: "^#[[:space:]]On branch [^ ]+"
+    - type.keyword: "^#[[:space:]]On branch"
+    # Color keywords for closing issues (such as on Github)
+    - type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b"
+
+    # Comments
+    - comment.line:
+        start: "^#"
+        end: "$"
+        rules: []
+
+    # Diffs (i.e. git commit --verbose)
+    - default:
+        start: "^diff --git"
+        # Diff output puts a space before file contents on each line so this
+        # should never match valid diff output and extend highlighting to the
+        # end of the file
+        end: "^ENDOFFILE"
+        limit-group: "magenta"
+        rules:
+            - include: "patch"