Skip to content

Commit

Permalink
Revive line-too-long matching in the grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Feb 6, 2023
1 parent c71bb8f commit f73545b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions syntaxes/git-commit.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"name": "meta.scope.subject.git-commit",
"match": "\\G.{0,50}(.{0,22}(.*))$",
"captures": {
"1": { "name": "meta.scope.subject-after-50.git-commit" },
"2": { "name": "meta.scope.subject-after-72.git-commit" }
"1": { "name": "invalid.deprecated.line-too-long.git-commit" },
"2": { "name": "invalid.illegal.line-too-long.git-commit" }
}
}
]
Expand Down
9 changes: 4 additions & 5 deletions tests/unit/too-long-title.test
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# SYNTAX TEST "text.git-commit" "Message with too-long subject line"
The grammar used to highlight this subject line in red because it is > 50 characters long
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - invalid.deprecated.line-too-long.git-commit invalid.illegal.line-too-long.git-commit
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.scope.message.git-commit meta.scope.subject.git-commit
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.scope.subject-after-72.git-commit
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.scope.subject-after-50.git-commit
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.scope.subject-after-50.git-commit
# ^^^^^^^^^^^^^^^^^ meta.scope.subject-after-50.git-commit meta.scope.subject-after-72.git-commit
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - invalid.illegal.line-too-long.git-commit
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - invalid.deprecated.line-too-long.git-commit
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid.deprecated.line-too-long.git-commit
# ^^^^^^^^^^^^^^^^^ invalid.deprecated.line-too-long.git-commit invalid.illegal.line-too-long.git-commit
Not the subject line
# ^^^^^^^^^^^^^^^^^^ meta.scope.message.git-commit
# ^^^^^^^^^^^^^^^^^^ - meta.scope.subject.git-commit
Expand Down

0 comments on commit f73545b

Please sign in to comment.