diff --git a/Git Files/Comments.tmPreferences b/Git Files/Comments.tmPreferences new file mode 100644 index 00000000000..822228c855c --- /dev/null +++ b/Git Files/Comments.tmPreferences @@ -0,0 +1,21 @@ + + + + name + Comments + scope + text.git + settings + + shellVariables + + + name + TM_COMMENT_START + value + # + + + + + diff --git a/Git Files/Completions/Git Attributes - Attributes.sublime-completions b/Git Files/Completions/Git Attributes - Attributes.sublime-completions new file mode 100644 index 00000000000..365d57205fe --- /dev/null +++ b/Git Files/Completions/Git Attributes - Attributes.sublime-completions @@ -0,0 +1,18 @@ +{ + "scope": "meta.attributes-list.git.attributes - meta.mapping.value - punctuation.separator", + "completions": [ + {"trigger": "binary\tattribute", "contents": "binary"}, + {"trigger": "conflict-marker-size\tattribute", "contents": "conflict-marker-size"}, + {"trigger": "delta\tattribute", "contents": "delta"}, + {"trigger": "diff\tattribute", "contents": "diff"}, + {"trigger": "encoding\tattribute", "contents": "encoding"}, + {"trigger": "eol\tattribute", "contents": "eol"}, + {"trigger": "export-ignore\tattribute", "contents": "export-ignore"}, + {"trigger": "export-subst\tattribute", "contents": "export-subst"}, + {"trigger": "filter\tattribute", "contents": "filter"}, + {"trigger": "ident\tattribute", "contents": "ident"}, + {"trigger": "merge\tattribute", "contents": "merge"}, + {"trigger": "text\tattribute", "contents": "text"}, + {"trigger": "whitespace\tattribute", "contents": "whitespace"} + ] +} diff --git a/Git Files/Completions/Git Attributes - Diff.sublime-completions b/Git Files/Completions/Git Attributes - Diff.sublime-completions new file mode 100644 index 00000000000..b204f7c3df0 --- /dev/null +++ b/Git Files/Completions/Git Attributes - Diff.sublime-completions @@ -0,0 +1,25 @@ +{ + "scope": "meta.mapping.expect-value & meta.attribute.builtin.diff.git.attributes", + "completions": [ + {"trigger": "ada\t(built-in) diff", "contents": "ada"}, + {"trigger": "astextplain\t(built-in) diff", "contents": "astextplain"}, + {"trigger": "bibtex\t(built-in) diff", "contents": "bibtex"}, + {"trigger": "cpp\t(built-in) diff", "contents": "cpp"}, + {"trigger": "csharp\t(built-in) diff", "contents": "csharp"}, + {"trigger": "css\t(built-in) diff", "contents": "css"}, + {"trigger": "exif\t(built-in) diff", "contents": "exif"}, + {"trigger": "fortran\t(built-in) diff", "contents": "fortran"}, + {"trigger": "fountain\t(built-in) diff", "contents": "fountain"}, + {"trigger": "html\t(built-in) diff", "contents": "html"}, + {"trigger": "java\t(built-in) diff", "contents": "java"}, + {"trigger": "matlab\t(built-in) diff", "contents": "matlab"}, + {"trigger": "objc\t(built-in) diff", "contents": "objc"}, + {"trigger": "pascal\t(built-in) diff", "contents": "pascal"}, + {"trigger": "perl\t(built-in) diff", "contents": "perl"}, + {"trigger": "php\t(built-in) diff", "contents": "php"}, + {"trigger": "python\t(built-in) diff", "contents": "python"}, + {"trigger": "ruby\t(built-in) diff", "contents": "ruby"}, + {"trigger": "tex\t(built-in) diff", "contents": "tex"}, + {"trigger": "word\t(built-in) diff", "contents": "word"} + ] +} diff --git a/Git Files/Completions/Git Attributes - EOL.sublime-completions b/Git Files/Completions/Git Attributes - EOL.sublime-completions new file mode 100644 index 00000000000..558e2ce8cd8 --- /dev/null +++ b/Git Files/Completions/Git Attributes - EOL.sublime-completions @@ -0,0 +1,7 @@ +{ + "scope": "meta.mapping.expect-value & meta.attribute.builtin.eol.git.attributes", + "completions": [ + {"trigger": "crlf\teol", "contents": "crlf"}, + {"trigger": "lf\teol", "contents": "lf"} + ] +} diff --git a/Git Files/Completions/Git Attributes - Encoding.sublime-completions b/Git Files/Completions/Git Attributes - Encoding.sublime-completions new file mode 100644 index 00000000000..063c3d7aea2 --- /dev/null +++ b/Git Files/Completions/Git Attributes - Encoding.sublime-completions @@ -0,0 +1,42 @@ +{ + "scope": "meta.mapping.expect-value & meta.attribute.builtin.encoding.git.attributes", + "completions": [ + {"trigger": "ASCII\tAscii", "contents": "ascii"}, + {"trigger": "UTF-8\tUnicode", "contents": "utf-8"}, + {"trigger": "UTF-16 LE\tUnicode", "contents": "utf-16-le"}, + {"trigger": "UTF-16 BE\tUnicode", "contents": "utf-16-be"}, + {"trigger": "ISO 8859-1\tWestern", "contents": "iso-8859-1"}, + {"trigger": "ISO 8859-10\tNordic", "contents": "iso-8859-10"}, + {"trigger": "ISO 8859-13\tEstonian", "contents": "iso-8859-13"}, + {"trigger": "ISO 8859-14\tCeltic", "contents": "iso-8859-14"}, + {"trigger": "ISO 8859-15\tWestern", "contents": "iso-8859-15"}, + {"trigger": "ISO 8859-16\tRomanian", "contents": "iso-8859-16"}, + {"trigger": "ISO 8859-2\tCentral European", "contents": "iso-8859-2"}, + {"trigger": "ISO 8859-3\tWestern", "contents": "iso-8859-3"}, + {"trigger": "ISO 8859-4\tBaltic", "contents": "iso-8859-4"}, + {"trigger": "ISO 8859-5\tCyrillic", "contents": "iso-8859-5"}, + {"trigger": "ISO 8859-6\tArabic", "contents": "iso-8859-6"}, + {"trigger": "ISO 8859-7\tGreek", "contents": "iso-8859-7"}, + {"trigger": "ISO 8859-8\tHebrew", "contents": "iso-8859-8"}, + {"trigger": "ISO 8859-9\tTurkish", "contents": "iso-8859-9"}, + {"trigger": "Windows 866\tCyrillic", "contents": "windows-866"}, + {"trigger": "Windows 1250\tCentral European", "contents": "windows-1250"}, + {"trigger": "Windows 1251\tCyrillic", "contents": "windows-1251"}, + {"trigger": "Windows 1252\tWestern", "contents": "windows-1252"}, + {"trigger": "Windows 1253\tGreek", "contents": "windows-1253"}, + {"trigger": "Windows 1254\tTurkish", "contents": "windows-1254"}, + {"trigger": "Windows 1255\tHebrew", "contents": "windows-1255"}, + {"trigger": "Windows 1256\tArabic", "contents": "windows-1256"}, + {"trigger": "Windows 1257\tBaltic", "contents": "windows-1257"}, + {"trigger": "Windows 1258\tVietnamese", "contents": "windows-1258"}, + {"trigger": "big5\tChineese Traditional", "contents": "gb2312"}, + {"trigger": "CP 437\tDOS", "contents": "cp-437"}, + {"trigger": "euc_jp\tJapaneese", "contents": "euc_jp"}, + {"trigger": "euc_kr\tKorean", "contents": "euc_kr"}, + {"trigger": "gb2312\tChineese Simplified", "contents": "gb2312"}, + {"trigger": "KOI8-R\tCyrillic", "contents": "koi8-r"}, + {"trigger": "KOI8-U\tCyrillic", "contents": "koi8-u"}, + {"trigger": "Mac Roman\tWestern", "contents": "mac-roman"}, + {"trigger": "Shift_JIS\tJapaneese", "contents": "Shift_JIS"}, + ] +} diff --git a/Git Files/Completions/Git Attributes - Filter.sublime-completions b/Git Files/Completions/Git Attributes - Filter.sublime-completions new file mode 100644 index 00000000000..a19ce443620 --- /dev/null +++ b/Git Files/Completions/Git Attributes - Filter.sublime-completions @@ -0,0 +1,5 @@ +{ + "scope": "meta.mapping.expect-value & meta.attribute.builtin.filter.git.attributes", + "completions": [ + ] +} diff --git a/Git Files/Completions/Git Attributes - Merge.sublime-completions b/Git Files/Completions/Git Attributes - Merge.sublime-completions new file mode 100644 index 00000000000..40c5890d094 --- /dev/null +++ b/Git Files/Completions/Git Attributes - Merge.sublime-completions @@ -0,0 +1,13 @@ +{ + "scope": "meta.mapping.expect-value & meta.attribute.builtin.merge.git.attributes", + "completions": [ + {"trigger": "binary\t(built-in) merge", "contents": "binary"}, + {"trigger": "ours\t(built-in) merge", "contents": "ours"}, + {"trigger": "patience\t(built-in) merge", "contents": "patience"}, + {"trigger": "recursive\t(built-in) merge", "contents": "recursive"}, + {"trigger": "resolve\t(built-in) merge", "contents": "resolve"}, + {"trigger": "text\t(built-in) merge", "contents": "text"}, + {"trigger": "theirs\t(built-in) merge", "contents": "theirs"}, + {"trigger": "union\t(built-in) merge", "contents": "union"} + ] +} diff --git a/Git Files/Completions/Git Attributes - Text.sublime-completions b/Git Files/Completions/Git Attributes - Text.sublime-completions new file mode 100644 index 00000000000..2050cc4d34e --- /dev/null +++ b/Git Files/Completions/Git Attributes - Text.sublime-completions @@ -0,0 +1,6 @@ +{ + "scope": "meta.mapping.expect-value & meta.attribute.builtin.text.git.attributes", + "completions": [ + {"trigger": "auto\ttext", "contents": "auto"} + ] +} diff --git a/Git Files/Completions/Git Attributes - Whitespace.sublime-completions b/Git Files/Completions/Git Attributes - Whitespace.sublime-completions new file mode 100644 index 00000000000..d9f82af488e --- /dev/null +++ b/Git Files/Completions/Git Attributes - Whitespace.sublime-completions @@ -0,0 +1,13 @@ +{ + "scope": "meta.mapping.expect-value & meta.attribute.builtin.whitespace.git.attributes", + "completions": [ + {"trigger": "blank-at-eof\twhitespace", "contents": "blank-at-eof"}, + {"trigger": "blank-at-eol\twhitespace", "contents": "blank-at-eol"}, + {"trigger": "cr-at-eol\twhitespace", "contents": "cr-at-eol"}, + {"trigger": "indent-with-non-tab\twhitespace", "contents": "indent-with-non-tab"}, + {"trigger": "space-before-tab\twhitespace", "contents": "space-before-tab"}, + {"trigger": "tab-in-indent\twhitespace", "contents": "tab-in-indent"}, + {"trigger": "trailing-space\twhitespace", "contents": "trailing-space"}, + {"trigger": "tabwidth=x\twhitespace", "contents": "tabwidth=${0:8}"} + ] +} diff --git a/Git Files/Git Attributes.sublime-settings b/Git Files/Git Attributes.sublime-settings new file mode 100644 index 00000000000..ed754f1a9e6 --- /dev/null +++ b/Git Files/Git Attributes.sublime-settings @@ -0,0 +1,14 @@ +{ + "auto_complete_selector": "text.git - comment - string.quoted", + "auto_complete_triggers": [ + { + "selector": "meta.attributes-list.git.attributes - meta.attribute - punctuation.separator", + "characters": " -!" + }, + { + "selector": "meta.attribute.builtin & meta.mapping.expect-value.git.attributes", + "characters": "-=," + } + ], + "word_separators": "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?" // default without '-' +} diff --git a/Git Files/Git Attributes.sublime-syntax b/Git Files/Git Attributes.sublime-syntax new file mode 100644 index 00000000000..4bba0ccf6b9 --- /dev/null +++ b/Git Files/Git Attributes.sublime-syntax @@ -0,0 +1,210 @@ +%YAML 1.2 +--- +# Syntax based on documentation here: +# https://git-scm.com/docs/gitattributes +# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes + +# Examples: https://github.com/alexkaratarakis/gitattributes + +name: Git Attributes +file_extensions: + - attributes # .git/info/attributes + - gitattributes # *.gitattributes + - .gitattributes # ~/.gitattributes +scope: text.git.attributes + +contexts: + + main: + - include: Git Common.sublime-syntax#comments-line + - include: macro + - include: pattern + +##[ MACROS ]########################################################### + + macro: + - match: (\[)([^-!]\S*)(\]) + scope: meta.brackets.git.attributes + captures: + 1: punctuation.definition.brackets.begin.git.attributes + 2: string.unquoted.git.attributes entity.name.macro.git.attributes + 3: punctuation.definition.brackets.end.git.attributes + push: attributes-list + +##[ PATH PATTERN ]##################################################### + + pattern: + # ignore whitespace at the beginning of a line + # patterns may not start with operators: - ! [ + - match: '[-!\[]|(?=\S)' + scope: invalid.illegal.operator.git.attributes + push: [pattern-attributes, pattern-content] + + pattern-content: + # quoted path pattern + - match: \" + scope: punctuation.definition.string.begin.git.attributes + set: [pattern-content-quoted, Git Common.sublime-syntax#fnmatch-start] + # unquoted path pattern + - match: '' + set: [pattern-content-unquoted, Git Common.sublime-syntax#fnmatch-start] + + pattern-content-quoted: + - meta_scope: string.quoted.double.git.attributes + - meta_content_scope: entity.name.pattern.git.attributes + - include: string-end + - include: Git Common.sublime-syntax#fnmatch-body + + pattern-content-unquoted: + - meta_scope: string.unquoted.git.attributes + - meta_content_scope: entity.name.pattern.git.attributes + - match: (?=\s) + pop: true + - include: Git Common.sublime-syntax#fnmatch-body + + pattern-attributes: + - match: '' + set: attributes-list + +##[ ATTRIBUTES LIST ]################################################## + + attributes-list: + - meta_content_scope: meta.attributes-list.git.attributes + # attriubte list ends with line + - match: $\n? + scope: meta.attributes-list.git.attributes + pop: true + # set/unset operators + - match: '[-!](?=\w)' + scope: keyword.operator.logical.git.attributes + # known attributes + - match: (?=diff\b) + push: [meta-diff, attribute-key] + - match: (?=encoding\b) + push: [meta-encoding, attribute-key] + - match: (?=eol\b) + push: [meta-eol, attribute-key] + - match: (?=filter\b) + push: [meta-filter, attribute-key] + - match: (?=merge\b) + push: [meta-merge, attribute-key] + - match: (?=text\b) + push: [meta-text, attribute-key] + - match: (?=whitespace\b) + push: [meta-whitespace, attribute-key] + # unknown/other attribute + - match: (?=\w) + push: [meta-other, attribute-key] + # close the meta mapping gab + - match: \s+ + scope: meta.mapping.git.attributes + # invalid attribute name + - match: \S+ + scope: invalid.illegal.attribute-name.git.attributes + + meta-diff: + - meta_scope: meta.attribute.builtin.diff.git.attributes + - include: else-pop + + meta-encoding: + - meta_scope: meta.attribute.builtin.encoding.git.attributes + - include: else-pop + + meta-eol: + - meta_scope: meta.attribute.builtin.eol.git.attributes + - include: else-pop + + meta-filter: + - meta_scope: meta.attribute.builtin.filter.git.attributes + - include: else-pop + + meta-merge: + - meta_scope: meta.attribute.builtin.merge.git.attributes + - include: else-pop + + meta-text: + - meta_scope: meta.attribute.builtin.text.git.attributes + - include: else-pop + + meta-whitespace: + - meta_scope: meta.attribute.builtin.whitespace.git.attributes + - include: else-pop + + meta-other: + - meta_scope: meta.attribute.other.git.attributes + - include: else-pop + +##[ ATTRIBUTE KEY VALUE ]############################################## + + attribute-key: + - match: \w+[-\w]*\b + scope: meta.mapping.key.git.attributes variable.language.attribute.git.attributes + set: attribute-maybe-value-list + - include: else-pop + + attribute-maybe-value-list: + - meta_content_scope: meta.mapping.git.attributes + - match: =(?=\S) + scope: punctuation.separator.mapping.key-value.git.attributes + set: [attribute-value-list, attribute-value-content] + - match: = + scope: punctuation.separator.mapping.key-value.git.attributes + set: attribute-value-expected + - include: attribute-separator + - include: else-pop + + attribute-value-list: + - meta_content_scope: meta.mapping.value.git.attributes + - include: attribute-separator + - match: ',(?=\S)' + scope: punctuation.separator.mapping.values.git.attributes + push: attribute-value-content + - match: ',' + scope: punctuation.separator.mapping.values.git.attributes + set: attribute-value-expected + - match: \S + scope: invalid.illegal.value.git.attributes + - include: else-pop + + attribute-value-content: + # double quoted value + - match: \" + scope: punctuation.definition.string.begin.git.attributes + set: + - meta_scope: string.quoted.double.git.attributes + - include: string-end + - match: \\[\\\"\'fnrst] + scope: constant.character.escape.git.attributes + # unquoted value is everything except , and whitespace + - match: '[^,\s]*' + scope: string.unquoted.git.attributes + pop: true + - include: else-pop + + attribute-value-expected: + # Attributes are separated by whitespace + # One whitespace after each attribute/value is captured as separator + - match: \s + scope: meta.mapping.expect-value.git.attributes punctuation.separator.mapping.pair.git.attributes + pop: true + + attribute-separator: + # Attributes are separated by whitespace + # One whitespace after each attribute/value is captured as separator + - match: \s + scope: meta.mapping.git.attributes punctuation.separator.mapping.pair.git.attributes + pop: true + +##[ PROTOTYPES ]####################################################### + + string-end: + - match: \" + scope: punctuation.definition.string.end.git.attributes + pop: true + - match: $\n? + scope: invalid.illegal.unexpected.eol.git.attributes + pop: true + + else-pop: + - match: '' + pop: true diff --git a/Git Files/Git Commit.sublime-syntax b/Git Files/Git Commit.sublime-syntax new file mode 100644 index 00000000000..c2b5304332c --- /dev/null +++ b/Git Files/Git Commit.sublime-syntax @@ -0,0 +1,170 @@ +%YAML 1.2 +--- +# Highlight regular git commits, merge commits, and tags. + +name: Git Commit +file_extensions: + - COMMIT_EDITMSG + - MERGE_MSG + - TAG_EDITMSG +scope: text.git.commit + +variables: + comment_char: '[#;]' + hash: \b\h{7,}\b + # Rebase operations + shortcut: '[defprsx]' + operator: \b(?:drop|edit|exec|fixup|pick|reword|squash|{{shortcut}})\b + # The following variables are required to support highlighting of special phrases + # in the git commit messages for all supported languages. + # Source: https://github.com/git/git/tree/master/po + # Languages: bg,ca,de,fr,is,it,ko,pt_PT,ru,sv,vi,zh_CH + on_branch: On branch|На клон|En la branca|Auf Branch|Sur la branche|Sul branch|현재 브랜치|No ramo|На ветке|På grenen|Trên nhánh|位于分支 + date: Date|Дата|Data|Datum|Date|@is.po|@it.po|시각|Data|Дата|Datum|Ngày tháng|日期 + # file state variables + # - @it.po , @is.po means no translation in the file found + # - the order is used from the *.po files for easy multi cursor copy & paste + both_deleted: both deleted|изтрити в двата случая|suprimit per ambdós|beide gelöscht|supprimé des deux côtés|@is.po|@it.po|양쪽에서 삭제|eliminado por ambos|оба удалены|borttaget av bägge|bị xóa bởi cả hai|双方删除 + added_by_us: added by us|добавени от вас|afegit per nosaltres|von uns hinzugefügt|ajouté par nous|@is.po|@it.po|이 쪽에서 추가|adicionado por nós|добавлено нами|tillagt av oss|được thêm vào bởi chúng ta|由我们添加 + deleted_by_them: deleted by them|изтрити от тях|suprimit per ells|von denen gelöscht|supprimé par eux|@is.po|@it.po|저 쪽에서 삭제|eliminado por eles|удалено ими|borttaget av dem|bị xóa đi bởi họ|由他们删除 + added_by_them: added by them|добавени от тях|afegit per ells|von denen hinzugefügt|ajouté par eux|@is.po|@it.po|저 쪽에서 추가|adicionado por eles|добавлено ими|tillagt av dem|được thêm vào bởi họ|由他们添加 + deleted_by_us: deleted by us|изтрити от вас|suprimit per nosaltres|von uns gelöscht|supprimé par nous|@is.po|@it.po|이 쪽에서 삭제|eliminado por nós|удалено нами|borttaget av oss|bị xóa bởi chúng ta|由我们删除 + both_added: both added|добавени и в двата случая|afegit per ambdós|von beiden hinzugefügt|ajouté de deux côtés|@is.po|@it.po|양쪽에서 추가|adicionado por ambos|оба добавлены|tillagt av bägge|được thêm vào bởi cả hai|双方添加 + both_modified: both modified|променени и в двата случая|modificat per ambdós|von beiden geändert|modifié des deux côtés|@is.po|@it.po|양쪽에서 수정|modificado por ambos|оба изменены|ändrat av bägge|bị sửa bởi cả hai|双方修改 + new_file: new file|нов файл|fitxer nou|neue Datei|nouveau fichier|@is.po|nuovo file|새 파일|novo ficheiro|новый файл|ny fil|tập tin mới|新文件 + copied: copied|копиран|copiat|kopiert|copié|@is.po|copiato|복사함|copiado|скопировано|kopierad|đã chép|拷贝 + deleted: deleted|изтрит|suprimit|gelöscht|supprimé|@is.po|eliminato|삭제함|eliminado|удалено|borttagen|đã xóa|删除 + modified: modified|променен|modificat|geändert|modifié|@is.po|modificato|수정함|modificado|изменено|ändrad|đã sửa|修改 + renamed: renamed|преименуван|canviat de nom|umbenannt|renommé|@is.po|rinominato|이름 바꿈|nome mudado|переименовано|namnbytt|đã đổi tên|重命名 + typechange: typechange|смяна на вида|canviat de tipus|Typänderung|modif. type|@is.po|typechange|종류 바뀜|tipo alterado|изменен тип|typbyte|đổi-kiểu|类型变更 + unknown: unknown|непозната промяна|desconegut|unbekannt|inconnu|@is.po|sconosciuto|알 수 없음|desconhecido|неизвестно|okänd|không hiểu|未知 + unmerged: unmerged|неслят|sense fusionar|nicht gemerged|non fusionné|@is.po|@it.po|병합하지 않음|não integrado|не слитые|osammanslagen|chưa hòa trộn|未合并 + +contexts: + prototype: + - include: dropped-content + - include: comments + + main: + - match: ^\s*(?=\S) + set: commit-subject + +##[ COMMITS ]########################################################## + + commit-subject: + # first none empty none comment line is commit subject + - meta_scope: meta.subject.git.commit markup.heading.subject.git.commit + - match: $\n? + set: commit-separator + - include: Git Common.sublime-syntax#references + + commit-separator: + # empty line between subject and message + - match: \n + set: commit-message + - match: \S.* + scope: invalid.illegal.empty-line-expected.git.commit + + commit-message: + # all none comment lines after subject belong to the message + - match: ^ + push: + - meta_include_prototype: false + - meta_scope: meta.message.git.commit + - match: ^(?=#) + pop: true + - include: Git Common.sublime-syntax#references + - include: signed-off + + signed-off: + - match: ^\s*(Signed-off-by)\s*(:) + captures: + 1: keyword.other.signed-off-by.git.commit + 2: punctuation.separator.mapping.pair.git.commit + +##[ COMMENTS ]######################################################### + + comments: + - match: ^{{comment_char}} + scope: punctuation.definition.comment.git.commit + push: + - meta_include_prototype: false + - meta_scope: comment.line.git.commit + - match: $\n? + pop: true + - include: branch-line + - include: change-list + - include: commands-line + - include: date-line + - include: heading + + branch-line: + - match: \b({{on_branch}})\s+(.*) + captures: + 1: markup.heading.on-branch.git.commit + 2: constant.language.branch-name.git.commit + + change-list: + # list body + - match: \b({{new_file}}|{{added_by_them}}|{{added_by_us}}|{{both_added}})\s*(:)\s*(.*) + scope: meta.change-list.git.commit + captures: + 1: keyword.other.change-list.git.commit + 2: punctuation.separator.mapping.pair.change-list.git.commit + 3: string.unquoted.git.commit markup.inserted.file.git.commit + - match: \b({{copied}}|{{renamed}}|{{typechange}})\s*(:)\s*(.*) + scope: meta.change-list.git.commit + captures: + 1: keyword.other.change-list.git.commit + 2: punctuation.separator.mapping.pair.change-list.git.commit + 3: string.unquoted.git.commit markup.changed.file.name.git.commit + - match: \b({{modified}}|{{both_modified}})\s*(:)\s*(.*) + scope: meta.change-list.git.commit + captures: + 1: keyword.other.change-list.git.commit + 2: punctuation.separator.mapping.pair.change-list.git.commit + 3: string.unquoted.git.commit markup.changed.file.content.git.commit + - match: \b({{deleted}}|{{deleted_by_them}}|{{deleted_by_us}}|{{both_deleted}})\s*(:)\s*(.*) + scope: meta.change-list.git.commit + captures: + 1: keyword.other.change-list.git.commit + 2: punctuation.separator.mapping.pair.change-list.git.commit + 3: string.unquoted.git.commit markup.deleted.file.git.commit + - match: \b({{unknown}}|{{unmerged}})\s*(:)\s*(.*) + scope: meta.change-list.git.commit + captures: + 1: keyword.other.change-list.git.commit + 2: punctuation.separator.mapping.pair.change-list.git.commit + 3: string.unquoted.git.commit markup.ignored.file.git.commit + + commands-line: + # A rebase commit message's comment contains the list of the recent + # operations to help understand the context of the current commit. + - match: \s*({{operator}})\s+({{hash}})\s+(.+?)\s*$ + scope: meta.command-list.git.commit + captures: + 1: keyword.operator.git.commit + 2: constant.numeric.hex.hash.git.commit + 3: string.unquoted.subject.git.commit + + date-line: + - match: \b({{date}})\s*(:)\s*(.*) + captures: + 1: markup.heading.git.commit + 2: punctuation.separator.mapping.pair.date.git.commit + 3: constant.language.timestamp.git.commit + + heading: + # all comments ending with colon are scoped as headlines + - match: \b\w.+(?=:\s*$) + scope: markup.heading.git.commit + + dropped-content: + # ------------------------ >8 ------------------------ + - match: '{{comment_char}} -{24} >8 -{24}\s*\n' + scope: comment.line.git.commit markup.bold.commit + set: + - meta_content_scope: meta.dropped.git.commit + - include: comments + - match: ^(?=diff --git) + set: [Packages/Diff/Diff.sublime-syntax] diff --git a/Git Files/Git Common.sublime-syntax b/Git Files/Git Common.sublime-syntax new file mode 100644 index 00000000000..0efa7e7c336 --- /dev/null +++ b/Git Files/Git Common.sublime-syntax @@ -0,0 +1,161 @@ +%YAML 1.2 +--- +# This file is some kind of internal library which is used to store +# common rules which are used by the visible syntax files. +name: Git Common +hidden: true +scope: text.git.common + +variables: + comment_char: '[#;]' + +contexts: + main: + - include: references + +##[ COMMENTS ]######################################################### + + comments: + # comment which may start in the middle of a line + - match: ({{comment_char}}).*\n? + scope: comment.line.git + captures: + 1: punctuation.definition.comment.git + + comments-line: + # comment which must start at the beginning of a line + - match: ^\s*({{comment_char}}).*\n? + scope: comment.line.git + captures: + 1: punctuation.definition.comment.git + +##[ REFERENCES ]####################################################### + + references: + # all github references + - include: issue + - include: email + - include: username + + issue: + # issue reference + # https://help.github.com/articles/closing-issues-using-keywords + - match: |- + (?x) + # optional closing keyword + (?i: + ( (?:close|fixe|resolve)[ds]? | fix ) # keyword + \s* (:)? \s* # optional colon separator + )? # keyword is optional + # user/repo#issue + ( + (?: + \b(?: \w+ (/) )? \w+ # user (optional) / repo + )? + (\#)[0-9]+ # issue number + )\b + scope: meta.reference.issue.git + captures: + 1: keyword.other.resolved-issue.git + 2: punctuation.separator.mapping.pair.resolved-issue.git + 3: constant.other.reference.issue.git + 4: punctuation.separator.reference.issue.git + 5: punctuation.definition.reference.issue.git + + email: + # email reference + - match: (<)(\S+(\@)\S+?(\.)\S+)(>) + scope: meta.reference.email.git + captures: + 1: punctuation.definition.reference.email.begin.git + 2: entity.name.reference.email.git + 3: punctuation.separator.email.git + 4: punctuation.separator.email.git + 5: punctuation.definition.reference.email.end.git + + username: + # user reference + - match: (\@)\w+\b + scope: meta.reference.username.git entity.name.reference.username.git + captures: + 1: punctuation.definition.reference.username.git + +##[ FNMATCH ]########################################################## + + # The first characters of a path pattern may have special meaning and + # must therefore be treated differently. This scope finally pops off + # if no more match is found. It must therefore be used as multi-push. + fnmatch-start: + # windows drive letter and separator + - match: '[A-Za-z](:)(?=/)' + captures: + 1: punctuation.separator.drive.fnmatch.git + pop: true + # homedir tilde operator + - match: ~(?=/) + scope: variable.language.environment.home.fnmatch.git + pop: true + # any other directory pattern + - include: fnmatch-dir-pattern + + # In order to use fnmatch by other syntaxes, it is importand to use + # fnmatch-body as include in a scope, which defines the desired meta + # and the required bail-out scopes as they might be different and + # therefore are not part of the following section. + fnmatch-body: + - match: \[ # shell style character class + scope: keyword.control.char-class.begin.fnmatch.git + push: + - fnmatch-char-class-body + - fnmatch-char-class-start + - fnmatch-char-class-operator + - match: '/' # path separators + scope: punctuation.separator.path.fnmatch.git + push: fnmatch-dir-pattern + - match: \.(?!.*[./]) # the last dot not followed by path sep + scope: punctuation.separator.path.extension.fnmatch.git + - match: '[*?]' # unescapable operators + scope: keyword.operator.path.asterix.fnmatch.git + - match: '\\[^$*?]' # backslash escapes nearly everything + scope: constant.character.escape.path.fnmatch.git + - match: \$\w+ + scope: variable.language.environment.other.fnmatch.git + - match: ':' # drive separators + scope: invalid.illegal.separator.drive.fnmatch.git + - match: '\\(?=\s)' # single backslash is invalid + scope: invalid.illegal.escape.path.fnmatch.git + + fnmatch-dir-pattern: + - match: \.\.(?=/) + scope: constant.language.path.parent.fnmatch.git + pop: true + - match: \.(?=/) + scope: constant.language.path.self.fnmatch.git + pop: true + - match: '' + pop: true + + fnmatch-char-class-operator: + - match: '[!^]?' # optional pattern negation + scope: keyword.operator.logical.fnmatch.git + pop: true + + fnmatch-char-class-start: + - match: \]? # first unescaped ']' is matched as normal char + scope: constant.character.char-class.fnmatch.git + pop: true + + fnmatch-char-class-body: + - meta_scope: meta.char-class.fnmatch.git + - match: \] + scope: keyword.control.char-class.end.fnmatch.git + pop: true + - match: $\n? # class must end before end of line + scope: invalid.illegal.unexpected.eol.fnmatch.git + pop: true + - match: '\\\]' # backslash escapes only ']' + scope: constant.character.escape.char-class.fnmatch.git + - match: '[*?]' # asterix is ignored by fnmatch + scope: invalid.illegal.unexpected.char-class.fnmatch.git + - match: \S + scope: constant.character.char-class.fnmatch.git diff --git a/Git Files/Git Config - Indentation Rules.tmPreferences b/Git Files/Git Config - Indentation Rules.tmPreferences new file mode 100644 index 00000000000..14d22608290 --- /dev/null +++ b/Git Files/Git Config - Indentation Rules.tmPreferences @@ -0,0 +1,16 @@ + + + + name + Indentation Rules + scope + text.git.config + settings + + decreaseIndentPattern + + increaseIndentPattern + + + + diff --git a/Git Files/Git Config - Symbol List.tmPreferences b/Git Files/Git Config - Symbol List.tmPreferences new file mode 100644 index 00000000000..5dbea2e9819 --- /dev/null +++ b/Git Files/Git Config - Symbol List.tmPreferences @@ -0,0 +1,14 @@ + + + + name + Symbol List + scope + meta.brackets.git.config + settings + + showInSymbolList + 1 + + + diff --git a/Git Files/Git Config.sublime-syntax b/Git Files/Git Config.sublime-syntax new file mode 100644 index 00000000000..fe977c3ce7d --- /dev/null +++ b/Git Files/Git Config.sublime-syntax @@ -0,0 +1,230 @@ +%YAML 1.2 +--- +# Syntax based on documentation here: +# https://git-scm.com/docs/git-config#_syntax + +name: Git Config +file_extensions: + - gitconfig # /etc/gitconfig + - .gitconfig # ~/.gitconfig +first_line_match: ^\[core\] # .git/config files always start with [core] +scope: text.git.config + +variables: + variable_name: '[a-zA-Z][\w-]*' + zero_to_255: 25[0-5]|2[0-4][0-9]|1\d\d|[1-9][0-9]|[0-9] + +contexts: + prototype: + - include: Git Common.sublime-syntax#comments + + main: + # We only want to match color values under these subsections: + # [color "branch"] + # [color "diff"] + # [color "interactive"] + # [color "status"] + # Note that this does not match [color] (without the subsection). This is + # because [color] doesn't actually take color values. + - match: ^\s*(?=\[\s*color\s+\") + push: [key-color-pair, section-header] + # section-other matches all sections except [color "subsection"]. + - match: ^\s*(?=\[) + push: [key-value-pair, section-header] + +##[ SECTION HEADERS ]################################################## + + section-header: + - match: \[ + scope: punctuation.definition.brackets.begin.git.config + set: [expect-line-end, section-header-end, section-name] + + section-header-end: + - meta_scope: meta.brackets.git.config + - match: \] + scope: punctuation.definition.brackets.end.git.config + pop: true + - include: illegal-line-end-pop + - match: \S + scope: invalid.illegal.header-end.git.config + + section-name: + - match: '[\w-]+' + scope: entity.name.section.git.config + - match: \" + scope: punctuation.definition.string.begin.git.config + set: subsection-name-quoted + - match: \. + scope: punctuation.accessor.dot.git.config + set: subsection-name-unquoted + - match: (?=\]) + pop: true + - include: illegal-line-end-pop + - match: \S + scope: invalid.illegal.section-name.git.config + + # [section "subsection"] + subsection-name-quoted: + - meta_include_prototype: false + - meta_scope: string.quoted.double.git.config + - match: \" + scope: punctuation.definition.string.end.git.config + pop: true + - match: \\[\\"] + scope: constant.character.escape.git.config + # `\` is legal, but it can lead to confusion because escapes like `\t` + # are interpreted as `t` by the git config parser, not TAB or "\t" + # (two chars). Therefore, we discourage the use of `\`. + - match: \\ + scope: invalid.unnecessary-escape.git.config + - include: illegal-line-end-pop + + # [section.subsection] + subsection-name-unquoted: + - match: '[\w-]+' + scope: string.unquoted.git.config + - match: \. + scope: punctuation.accessor.dot.git.config + - match: (?=\]) + pop: true + - include: illegal-line-end-pop + - match: \S + scope: invalid.illegal.subsection-name.git.config + + expect-section: + - match: (?=^\s*\[) # start of new section + pop: true + - match: \] + scope: punctuation.definition.brackets.end.git.config invalid.illegal.stray-bracket.git.config + +##[ SECTION BODY ]##################################################### + + # changed = red + # untracked = bold green + key-color-pair: + - match: ^(\s*)({{variable_name}})(\s*(\=)\s*) + captures: + 1: meta.mapping.git.config + 2: meta.mapping.key.git.config variable.other.readwrite.git.config + 3: meta.mapping.git.config + 4: keyword.operator.assignment.git.config + push: + - meta_content_scope: meta.mapping.value.git.config + - include: color-value + - include: line-end + - include: expect-section + + # key = val + key-value-pair: + - match: ^(\s*)({{variable_name}})(\s*(\=)\s*) + captures: + 1: meta.mapping.git.config + 2: meta.mapping.key.git.config variable.other.readwrite.git.config + 3: meta.mapping.git.config + 4: keyword.operator.assignment.git.config + push: + - meta_content_scope: meta.mapping.value.git.config + - include: other-value + - include: line-end + - include: expect-section + +##[ VALUES ]########################################################### + + color-value: + # example: bold, italic, underline + - match: \b(?:no-?)?(?:ul|strike|reverse|italic|dim|bold|blink)\b + scope: support.constant.color-attribute.git.config + # example: red, blue, green + - match: \b(?:yellow|white|red|normal|magenta|green|cyan|blue|black|auto)\b + scope: support.constant.color.git.config + # example: 0-255 + - match: \b(?:{{zero_to_255}})\b + scope: constant.other.color.rgb-value.git.config + + other-value: + - include: boolean + - include: shell-script + - include: string-quoted + - include: string-unquoted + + boolean: + # 0 and 1 are omitted due to mismatches (e.g. "log -1", "HEAD~1"). They will + # be matched as unquoted strings instead. + - match: \b(?:yes|true|on|off|no|false)\b + scope: constant.language.git.config + + shell-script: + - match: (\")(\!) + captures: + 1: string.quoted.double.git.config punctuation.definition.string.begin.git.config + 2: keyword.control.import.shell.git.config + escape: (? + # Date: Wed Sep 13 22:42:14 2017 +0200 + - match: ^(\w+)\s*(:)\s* + captures: + 1: keyword.other.header.git.log + 2: punctuation.separator.mapping.pair.git.log + push: + - meta_scope: meta.header.git.commit markup.raw.block.git.log + - meta_content_scope: string.unquoted.log + - match: \n + pop: true + - include: Git Common.sublime-syntax#email + - include: Git Commit.sublime-syntax diff --git a/Git Files/Git Rebase.sublime-syntax b/Git Files/Git Rebase.sublime-syntax new file mode 100644 index 00000000000..4653d19285f --- /dev/null +++ b/Git Files/Git Rebase.sublime-syntax @@ -0,0 +1,168 @@ +%YAML 1.2 +--- +# Highlight interactive rebase text (git rebase -i). + +name: Git Rebase Todo +file_extensions: + - git-rebase-todo +first_line_match: '^(?:drop|edit|exec|fixup|pick|reword|squash|[defprsx]) \h{7,} ' +scope: text.git.rebase + +variables: + comment_char: '[#;]' + hash: \b\h{7,}\b + +contexts: + + main: + - include: comments + - include: commit + +##[ COMMENTS ]######################################################### + + comments: + - match: ^\s*({{comment_char}}) + captures: + 1: punctuation.definition.comment.git.rebase + push: + - meta_scope: comment.line.git.rebase + - match: ^(?!\s*{{comment_char}}) + pop: true + - include: heading + - include: commands-help + - include: rebase-msg + + heading: + # all comments ending with colon are scoped as headlines + - match: \b\w.+(?=:\s*$) + scope: markup.heading.git.rebase + + commands-help: + # highlight the commands and separators in this comment + # e.g. p, pick = use commit + - match: \b(d)\s*(,)\s*(drop)\s*(=)\s*(.+) + scope: meta.commands-help.drop.git.rebase + captures: + 1: keyword.operator.commit.drop.git.rebase + 2: punctuation.separator.sequence.git.rebase + 3: keyword.operator.commit.drop.git.rebase + 4: punctuation.separator.mapping.pair.git.rebase + 5: string.unquoted.git.rebase + - match: \b(e)\s*(,)\s*(edit)\s*(=)\s*(.+) + scope: meta.commands-help.edit.git.rebase + captures: + 1: keyword.operator.commit.edit.git.rebase + 2: punctuation.separator.sequence.git.rebase + 3: keyword.operator.commit.edit.git.rebase + 4: punctuation.separator.mapping.pair.git.rebase + 5: string.unquoted.git.rebase + - match: \b(x)\s*(,)\s*(exec)\s*(=)\s*(.+) + scope: meta.commands-help.exec.git.rebase + captures: + 1: keyword.operator.commit.exec.git.rebase + 2: punctuation.separator.sequence.git.rebase + 3: keyword.operator.commit.exec.git.rebase + 4: punctuation.separator.mapping.pair.git.rebase + 5: string.unquoted.git.rebase + - match: \b(f)\s*(,)\s*(fixup)\s*(=)\s*(.+) + scope: meta.commands-help.fixup.git.rebase + captures: + 1: keyword.operator.commit.fixup.git.rebase + 2: punctuation.separator.sequence.git.rebase + 3: keyword.operator.commit.fixup.git.rebase + 4: punctuation.separator.mapping.pair.git.rebase + 5: string.unquoted.git.rebase + - match: \b(p)\s*(,)\s*(pick)\s*(=)\s*(.+) + scope: meta.commands-help.pick.git.rebase + captures: + 1: keyword.operator.commit.pick.git.rebase + 2: punctuation.separator.sequence.git.rebase + 3: keyword.operator.commit.pick.git.rebase + 4: punctuation.separator.mapping.pair.git.rebase + 5: string.unquoted.git.rebase + - match: \b(r)\s*(,)\s*(reword)\s*(=)\s*(.+) + scope: meta.commands-help.reword.git.rebase + captures: + 1: keyword.operator.commit.reword.git.rebase + 2: punctuation.separator.sequence.git.rebase + 3: keyword.operator.commit.reword.git.rebase + 4: punctuation.separator.mapping.pair.git.rebase + 5: string.unquoted.git.rebase + - match: \b(s)\s*(,)\s*(squash)\s*(=)\s*(.+) + scope: meta.commands-help.squash.git.rebase + captures: + 1: keyword.operator.commit.squash.git.rebase + 2: punctuation.separator.sequence.git.rebase + 3: keyword.operator.commit.squash.git.rebase + 4: punctuation.separator.mapping.pair.git.rebase + 5: string.unquoted.git.rebase + + rebase-msg: + # e.g. Rebase 9e73d21..6746220 onto 9e73d21 (2 commands) + # highlight the hashes in this comment + - match: Rebase\s+({{hash}})(?:(..)({{hash}}))?.+({{hash}}).* + scope: meta.rebase-msg.git.rebase markup.heading.git.rebase + captures: + 1: constant.numeric.hex.hash.git.rebase + 2: punctuation.separator.commit-range.git.rebase + 3: constant.numeric.hex.hash.git.rebase + 4: constant.numeric.hex.hash.git.rebase + +##[ COMMITS ]########################################################## + + commit: + # e.g. pick d284bb2 Initial commit + - match: ^\s* + push: [commit-subject, commit-hash, commit-commands] + + commit-commands: + - match: (?:d|drop)\b + scope: keyword.operator.commit.drop.git.rebase + pop: true + - match: (?:e|edit)\b + scope: keyword.operator.commit.edit.git.rebase + pop: true + - match: (?:x|exec)\b + scope: keyword.operator.commit.exec.git.rebase + pop: true + - match: (?:f|fixup)\b + scope: keyword.operator.commit.fixup.git.rebase + pop: true + - match: (?:p|pick)\b + scope: keyword.operator.commit.pick.git.rebase + pop: true + - match: (?:r|reword)\b + scope: keyword.operator.commit.reword.git.rebase + pop: true + - match: (?:s|squash)\b + scope: keyword.operator.commit.squash.git.rebase + pop: true + - include: line-end + - match: \S+ + scope: invalid.illegal.command-expected.git.rebase + pop: true + + commit-hash: + - match: '{{hash}}' # e.g. d284bb2 + scope: constant.numeric.hex.hash.git.rebase + pop: true + - include: line-end + - match: \S+ + scope: invalid.illegal.hash-expected.git.rebase + pop: true + + commit-subject: + - meta_scope: meta.commit.git.rebase + - include: line-end + - match: (?=\S) # subject beginns with first none whitespece + set: + - meta_scope: meta.commit.git.rebase + - meta_content_scope: meta.subject.git.commit + - include: Git Common.sublime-syntax#references + - include: line-end + +##[ PROTOTYPES ]####################################################### + + line-end: + - match: $\n? + pop: true diff --git a/Git Files/Snippets/Git Config - Section.sublime-snippet b/Git Files/Snippets/Git Config - Section.sublime-snippet new file mode 100644 index 00000000000..bdf9f3c6cb7 --- /dev/null +++ b/Git Files/Snippets/Git Config - Section.sublime-snippet @@ -0,0 +1,9 @@ + + + section + source.git.config + [section] + diff --git a/Git Files/syntax_test_git_attributes b/Git Files/syntax_test_git_attributes new file mode 100644 index 00000000000..0ff92a7707d --- /dev/null +++ b/Git Files/syntax_test_git_attributes @@ -0,0 +1,206 @@ +# SYNTAX TEST "Git Attributes.sublime-syntax" +# <- comment.line.git punctuation.definition.comment.git + +# valid macro definition +[macro-name] binary -diff !merge filter=none +# <- meta.brackets.git.attributes punctuation.definition.brackets.begin.git.attributes +#^^^^^^^^^^ meta.brackets.git.attributes entity.name.macro.git.attributes +# ^ meta.brackets.git.attributes punctuation.definition.brackets.end.git.attributes - meta.attributes-list.git.attributes +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.attributes-list.git.attributes - meta.brackets.git.attributes +# ^^^^^^ variable.language.attribute.git.attributes +# ^ keyword.operator.logical.git.attributes +# ^^^^ variable.language.attribute.git.attributes +# ^ keyword.operator.logical.git.attributes +# ^^^^^ variable.language.attribute.git.attributes +# ^^^^^^ variable.language.attribute.git.attributes +# ^ punctuation.separator.mapping.key-value.git.attributes +# ^^^^ string.unquoted.git.attributes +[macro\tws]attr +# <- meta.brackets.git.attributes punctuation.definition.brackets.begin.git.attributes +#^^^^^^^^^ meta.brackets.git.attributes entity.name.macro.git.attributes +# ^ meta.brackets.git.attributes punctuation.definition.brackets.end.git.attributes - meta.attributes-list.git.attributes +# ^^^^^ meta.attributes-list.git.attributes - meta.brackets.git.attributes +# ^^^^ variable.language.attribute.git.attributes + +# invlid whitespace in macro name are handled as invalid pattern +[macro ] attr +# <- invalid.illegal.operator.git.attributes - meta.attributes-list.git.attributes +#^^^^^ string.unquoted.git.attributes - meta.attributes-list.git.attributes +# ^^^^^^^^ meta.attributes-list.git.attributes - meta.pattern +# ^ invalid.illegal.attribute-name.git.attributes +# ^^^^ variable.language.attribute.git.attributes +[ macro ] attr +# <- invalid.illegal.operator.git.attributes - meta.attributes-list.git.attributes +#^^^^^^^^^^^^^^ meta.attributes-list.git.attributes - meta.pattern +# ^^^^^ variable.language.attribute.git.attributes +# ^ invalid.illegal.attribute-name.git.attributes +# ^^^^variable.language.attribute.git.attributes +[macro name ] attr +# <- invalid.illegal.operator.git.attributes - meta.attributes-list.git.attributes +#^^^^^ string.unquoted.git.attributes - meta.attributes-list.git.attributes +# ^^^^^^^^^^^^^ meta.attributes-list.git.attributes - meta.pattern +# ^^^^ variable.language.attribute.git.attributes +# ^ invalid.illegal.attribute-name.git.attributes +# ^^^^ variable.language.attribute.git.attributes + +# escaped '[' is handled as pattern for file name starting with '[' +\[macro\tws] attr +# <- string.unquoted.git.attributes +#^^^^^^^^^^^ string.unquoted.git.attributes +# ^^^^^^ meta.attributes-list.git.attributes +# ^^^^ variable.language.attribute.git.attributes +\[macro\tws]attr !attr +# <- string.unquoted.git.attributes entity.name.pattern.git.attributes +#^^^^^^^^^^^^^^^ string.unquoted.git.attributes entity.name.pattern.git.attributes - meta.attributes-list.git.attributes +# ^^^^^^^ meta.attributes-list.git.attributes - meta.pattern +# ^ keyword.operator.logical.git.attributes +# ^^^^ variable.language.attribute.git.attributes + +# quoted patterns +"[mac ro\tws]" attr="^0123456789abcde \t\n\\\"\'./()'-:,.;<>~!@#$%&*|+=[]{}`~?" attr2="qu ot1""invalid" +# <- string.quoted.double.git.attributes punctuation.definition.string.begin.git.attributes - entity.name.pattern.git +#^^^^^^^^^^^^^ string.quoted.double.git.attributes - meta.attributes-list.git.attributes +#^^^^^^^^^^^^ entity.name.pattern.git.attributes +# ^ punctuation.definition.string.end.git.attributes - entity.name.pattern.git +# ^^^^^^ meta.attributes-list.git.attributes +# ^^^^ variable.language.attribute.git.attributes +# ^ punctuation.separator.mapping.key-value.git.attributes +# ^ punctuation.definition.string.begin.git.attributes +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.git.attributes +# ^^^^^^^^^^ constant.character.escape.git.attributes +# ^ punctuation.definition.string.end.git.attributes +# ^^^^^ variable.language.attribute.git.attributes +# ^ punctuation.separator.mapping.key-value.git.attributes +# ^^^^^^^^ string.quoted.double.git.attributes +# ^^^^^^^^^ invalid.illegal.value.git.attributes + +# No space needed after quotation mark +"De?f\"a[Uu]lt ([Ww]indows)"encoding=utf-8 +# <- string.quoted.double.git.attributes punctuation.definition.string.begin.git.attributes - entity.name.pattern.git +#^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.git.attributes +#^^^^^^^^^^^^^^^^^^^^^^^^^^ entity.name.pattern.git +# ^ keyword.operator.path.asterix.fnmatch.git +# ^^ constant.character.escape.path.fnmatch.git +# ^^^^ meta.char-class.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^^ constant.character.char-class.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^^ constant.character.char-class.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ punctuation.definition.string.end.git.attributes +# ^^^^^^^^^^^^^^^ meta.attributes-list.git.attributes +# ^^^^^^^^^^^^^^^ meta.attribute +# ^^^^^^^^ meta.mapping.key.git.attributes variable.language.attribute.git.attributes +# ^ punctuation.separator.mapping.key-value.git.attributes +# ^^^^^ meta.mapping.value.git.attributes string.unquoted.git.attributes +# ^ meta.attribute meta.mapping.git.attributes punctuation.separator.mapping.pair.git.attributes + +# set binary content +/path/*.pb?proj binary -text !indent eol=crlf attr=val1,-val2,!val3 !attr2 # no-comment +# <- string.unquoted.git.attributes punctuation.separator.path.fnmatch.git +#^^^^^^^^^^^^^^ - meta.attributes-list.git.attributes +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.attributes-list.git.attributes - meta.pattern +#^^^^^^^^^^^^^^ string.unquoted.git.attributes +# ^ punctuation.separator.path.fnmatch.git +# ^ keyword.operator.path.asterix.fnmatch.git +# ^ punctuation.separator.path.extension.fnmatch.git +# ^ keyword.operator.path.asterix.fnmatch.git +# ^ - variable.language.attribute - keyword.operator.logical +# ^^^^^^ variable.language.attribute.git.attributes +# ^ - variable.language.attribute - keyword.operator.logical +# ^ keyword.operator.logical.git.attributes +# ^^^^ variable.language.attribute.git.attributes +# ^ - variable.language.attribute - keyword.operator.logical +# ^ keyword.operator.logical.git.attributes +# ^^^^^^ variable.language.attribute.git.attributes +# ^ - variable.language.attribute - keyword.operator.logical +# ^^^ variable.language.attribute.git.attributes +# ^ punctuation.separator.mapping.key-value.git.attributes +# ^^^^ string.unquoted.git.attributes +# ^ - variable.language.attribute - keyword.operator.logical +# ^^^^ variable.language.attribute.git.attributes +# ^ punctuation.separator.mapping.key-value.git.attributes +# ^^^^ string.unquoted.git.attributes +# ^ punctuation.separator.mapping.values.git.attributes +# ^^^^^ string.unquoted.git.attributes +# ^ punctuation.separator.mapping.values.git.attributes +# ^^^^^ string.unquoted.git.attributes +# ^ - variable.language.attribute - keyword.operator.logical +# ^ keyword.operator.logical.git.attributes +# ^^^^^ variable.language.attribute.git.attributes +# ^ invalid.illegal.attribute-name.git.attributes +# ^^^^^^^^^^ variable.language.attribute.git.attributes + +# check operator usage +\!*.jpg!text !attr1=!value !attr2 ! attr3 = no_val !!attr +# <- string.unquoted.git.attributes - invalid.illegal.operator - keyword.operator.logical +#^^^^^^^^^^^ string.unquoted.git.attributes - invalid.illegal.operator - keyword.operator.logical +# ^ keyword.operator.logical.git.attributes - invalid.illegal.operator - string.unquoted +# ^ string.unquoted.git.attributes - invalid.illegal.operator - keyword.operator.logical +# ^ keyword.operator.logical.git.attributes - invalid.illegal.operator - string.unquoted +# ^ invalid.illegal.attribute-name.git.attributes +# ^ invalid.illegal.attribute-name.git.attributes +# ^^^^^^ invalid.illegal.attribute-name.git.attributes +\-*.jpg-text -attr1=-value -attr2 - attr3 = no_val --attr +# <- string.unquoted.git.attributes - invalid.illegal.operator - keyword.operator.logical +#^^^^^^^^^^^ string.unquoted.git.attributes - invalid.illegal.operator - keyword.operator.logical +# ^ keyword.operator.logical.git.attributes - invalid.illegal.operator - string.unquoted +# ^ string.unquoted.git.attributes - invalid.illegal.operator - keyword.operator.logical +# ^ keyword.operator.logical.git.attributes - invalid.illegal.operator - string.unquoted +# ^ invalid.illegal.attribute-name.git.attributes +# ^ invalid.illegal.attribute-name.git.attributes +# ^^^^^^ variable.language.attribute.git.attributes - string +# ^^^^^^ invalid.illegal.attribute-name.git.attributes +!*.jpg!text +# <- invalid.illegal.operator.git.attributes - string.unquoted - keyword.operator.logical +# ^ string.unquoted.git.attributes - invalid.illegal.operator - keyword.operator.logical +-*.jpg-text +# <- invalid.illegal.operator.git.attributes - string.unquoted - keyword.operator.logical +# ^ string.unquoted.git.attributes - invalid.illegal.operator - keyword.operator.logical +- *.jpg-text attr +# ^^^^^^^^^^^^^^^^ meta.attributes-list.git.attributes +# <- invalid.illegal.operator.git.attributes +# ^^^^^^^^^^ invalid.illegal.attribute-name.git.attributes +# ^^^^ variable.language.attribute.git.attributes - invalid +- pattern attr +# <- invalid.illegal.operator.git.attributes - string.unquoted - keyword.operator.logical +# ^^^^^^^^^^^^^ meta.attributes-list.git.attributes +# ^^^^^^^ variable.language.attribute.git.attributes - string.unquoted +# ^^^^ variable.language.attribute.git.attributes + +# TEST: `meta.mapping.expect-value` at end of line +pattern attr= +# <- string.unquoted.git entity.name.pattern.git +#^^^^^^ string.unquoted.git entity.name.pattern.git +# ^^^^^^^ meta.attributes-list.git +# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git +# ^^^^ meta.mapping.key.git - meta.mapping.git - meta.mapping.value.git +# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git - meta.mapping.expect-value.git +# ^ punctuation.separator.mapping.key-value.git +# ^ meta.mapping.expect-value.git - meta.mapping.key.git - meta.mapping.git + +# TEST: `meta.mapping.expect-value` at end of line +pattern attr= no_value attr=value, eol=lf, +# <- string.unquoted.git entity.name.pattern.git +#^^^^^^ string.unquoted.git entity.name.pattern.git +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.attributes-list.git +# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git +# ^^^^ meta.mapping.key.git - meta.mapping.git - meta.mapping.value.git +# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git - meta.mapping.expect-value.git +# ^ punctuation.separator.mapping.key-value.git +# ^ meta.mapping.expect-value.git - meta.mapping.key.git - meta.mapping.git +# ^^^^^^^^ meta.attribute.other.git meta.mapping.key.git variable.language.attribute.git - meta.mapping.expect-value.git +# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git +# ^^^^ meta.mapping.key.git - meta.mapping.git - meta.mapping.value.git +# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git - meta.mapping.expect-value.git +# ^ punctuation.separator.mapping.key-value.git +# ^^^^^ string.unquoted.git.attributes +# ^^^^^^ meta.mapping.value.git - meta.mapping.key.git - meta.mapping.git - meta.mapping.expect-value.git +# ^ meta.mapping.expect-value.git - meta.mapping.key.git - meta.mapping.git +# ^^^ meta.mapping.key.git - meta.mapping.git - meta.mapping.value.git +# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git - meta.mapping.expect-value.git +# ^ punctuation.separator.mapping.key-value.git +# ^^ string.unquoted.git.attributes +# ^^^ meta.mapping.value.git - meta.mapping.key.git - meta.mapping.git - meta.mapping.expect-value.git +# ^ meta.mapping.expect-value.git - meta.mapping.key.git - meta.mapping.git diff --git a/Git Files/syntax_test_git_commit b/Git Files/syntax_test_git_commit new file mode 100644 index 00000000000..f8774b6d03a --- /dev/null +++ b/Git Files/syntax_test_git_commit @@ -0,0 +1,245 @@ +# SYNTAX TEST "Git Commit.sublime-syntax" +# <- text.git.commit comment.line punctuation.definition.comment +# This is a combination of 3 commits. +# This is the 1st commit message: +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.git.commit + +# <- - invalid.illegal +Add git package # no comment (#403) +# <- meta.subject.git.commit markup.heading.subject.git.commit - meta.expect-subject +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.subject.git.commit markup.heading.subject.git.commit +# ^^^^^^^^^^^^^^^^^^^ - comment +# ^ punctuation.definition.reference.issue.git +# ^^^^ meta.reference.issue.git constant.other.reference.issue.git +- +# <- invalid.illegal.empty-line-expected.git.commit +The message can contain # which is no comment start +# <- meta.message.git.commit - meta.subject - meta.expect-subject +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - comment.line +Thanks to @username . +# <- meta.message.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^ punctuation.definition.reference.username.git +# ^^^^^^^^^ entity.name.reference.username.git +# ^ - string.unquoted.reference.username.git +# ^ punctuation.definition.reference.email.begin.git +# ^^^^^^^^^^^^^^^^^^^^^ entity.name.reference.email.git +# ^ punctuation.separator.email.git +# ^ punctuation.separator.email.git +# ^ punctuation.definition.reference.email.end.git +Issue user/repo#230 is not closed yet. +# <- meta.message.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^^^^^^^^^^^^^ constant.other.reference.issue.git +# ^ punctuation.separator.reference.issue.git +# ^ punctuation.definition.reference.issue.git +# ^^^^^^ - keyword.other.resolved-issue.git +Issue repo#230 is not resolved yet. +# <- meta.message.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^^^^^^^^ constant.other.reference.issue.git +# ^ punctuation.definition.reference.issue.git +# ^^^^^^^^ - keyword.other.resolved-issue.git +Issue #230 is not fixed yet. +# <- meta.message.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^^^^ constant.other.reference.issue.git +# ^ punctuation.definition.reference.issue.git +# ^^^^^ - keyword.other.resolved-issue.git +This commit closes #230 # without comment. +# <- meta.message.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^^^^^^^^^^^ meta.reference.issue.git +# ^^^^^^ keyword.other.resolved-issue.git +# ^ punctuation.definition.reference.issue.git +# ^^^^ constant.other.reference.issue.git +# ^^^^^^^^^^^^^^^^^^^ - comment +fix #203 +# <- meta.message.git.commit meta.reference.issue.git keyword.other.resolved-issue.git +#^^^^^^^ meta.message.git.commit +#^^^^^^^ meta.reference.issue.git +#^^ keyword.other.resolved-issue.git +# ^ punctuation.definition.reference.issue.git +# ^^^^ constant.other.reference.issue.git +fixes #203 +# <- meta.message.git.commit meta.reference.issue.git keyword.other.resolved-issue.git +#^^^^^^^^^ meta.message.git.commit +#^^^^^^^^^ meta.reference.issue.git +#^^^^ keyword.other.resolved-issue.git +# ^ punctuation.definition.reference.issue.git +# ^^^^ constant.other.reference.issue.git +fixed #203 +# <- meta.message.git.commit meta.reference.issue.git keyword.other.resolved-issue.git +#^^^^^^^^^ meta.message.git.commit +#^^^^^^^^^ meta.reference.issue.git +#^^^^ keyword.other.resolved-issue.git +# ^ punctuation.definition.reference.issue.git +# ^^^^ constant.other.reference.issue.git +Fix: #203 +# <- meta.message.git.commit meta.reference.issue.git keyword.other.resolved-issue.git +#^^^^^^^^ meta.message.git.commit +#^^^^^^^^ meta.reference.issue.git +#^^ keyword.other.resolved-issue.git +# ^ punctuation.separator.mapping.pair.resolved-issue.git +# ^ punctuation.definition.reference.issue.git +# ^^^^ constant.other.reference.issue.git +# + +# This is the commit message #2: +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.git.commit + +Fix: JSON resource format errors +# <- meta.message.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit + +This commit applies all changes required to satisfy the JSON format unittest. +# <- meta.message.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit + +# The commit message #3 will be skipped: +# <- comment.line.git.commit punctuation.definition.comment.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.git.commit +# fixup! Fix: JSON resource format errors +# <- comment.line.git.commit punctuation.definition.comment.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# + Signed-off-by: username +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^ meta.reference.email.git +# ^^^^^^^^^^^^^ keyword.other.signed-off-by.git.commit +# ^ punctuation.separator.mapping.pair.git.commit +# ^ punctuation.definition.reference.email.begin.git +# ^^^^^^^^^^^^^^^^^^^^ entity.name.reference.email.git +# ^ - punctuation.separator.email.git +# ^ punctuation.separator.email.git +# ^ punctuation.separator.email.git +# ^ punctuation.definition.reference.email.end.git +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# +# Please enter the commit message for your changes. Lines starting +# <- text.git.commit comment.line punctuation.definition.comment +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Sun Aug 27 16:50:14 2017 -0700 +# <- comment.line.git.commit punctuation.definition.comment.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^ markup.heading.git.commit +# ^^^^^^^ - markup.heading.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.language.timestamp.git.commit +# +# interactive rebase in progress; onto 9e200cd +# Last commands done (3 commands done): +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.git.commit +# squash 26b2cc6 Fix: JSON resource format errors +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.command-list.git.commit +# ^^^^^^ keyword.operator.git.commit +# ^ - keyword.operator.git.commit - constant.numeric.hex.hash.git.commit +# ^^^^^^^ constant.numeric.hex.hash.git.commit +# ^ - constant.numeric.hex.hash.git.commit - string.unquoted.subject.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.subject.git.commit +# ^ - string.unquoted.subject.git.commit +# fixup 8e9e7bc fixup! Fix: JSON resource format errors +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.command-list.git.commit +# ^^^^^ keyword.operator.git.commit +# ^ - keyword.operator.git.commit - constant.numeric.hex.hash.git.commit +# ^^^^^^^ constant.numeric.hex.hash.git.commit +# ^ - constant.numeric.hex.hash.git.commit - string.unquoted.subject.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.subject.git.commit +# ^ - string.unquoted.subject.git.commit +# No commands remaining. +# You are currently rebasing branch 'pr/test_json' on '9e200cd'. +# +# On branch add_gitconfig_pkg +# <- comment.line.git.commit punctuation.definition.comment.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^ markup.heading.on-branch.git.commit +# ^^^^^^^^^^^^^^^^^ constant.language.branch-name.git.commit +# +# Changes to be committed: +# <- comment.line.git.commit punctuation.definition.comment.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.git.commit +# new file: gitconfig/Comments.tmPreferences +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^^^^^^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.inserted.file.git.commit +# modified: gitconfig/Snippets/section.sublime-snippet +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^^^^^^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.changed.file.content.git.commit +# deleted: gitconfig/Symbol List.tmPreferences +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^^^^^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.deleted.file.git.commit +# zum Commit vorgemerkte Änderungen: +# <- comment.line.git.commit punctuation.definition.comment.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.git.commit +# neue Datei: gitconfig/Comments.tmPreferences +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^^^^^^^^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.inserted.file.git.commit +# geändert: gitconfig/Snippets/section.sublime-snippet +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^^^^^^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.changed.file.content.git.commit +# gelöscht: gitconfig/Symbol List.tmPreferences +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^^^^^^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.deleted.file.git.commit +# 要提交的变更: +# <- comment.line.git.commit punctuation.definition.comment.git.commit +#^^^^^^^^ comment.line.git.commit +# ^^^^^^ markup.heading.git.commit +# 新文件: gitconfig/Comments.tmPreferences +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.inserted.file.git.commit +# 修改: gitconfig/Snippets/section.sublime-snippet +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.changed.file.content.git.commit +# 删除: gitconfig/Symbol List.tmPreferences +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.change-list.git.commit +# ^^ keyword.other.change-list.git.commit +# ^ punctuation.separator.mapping.pair.change-list.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.commit markup.deleted.file.git.commit +# ------------------------ >8 ------------------------ +# Do not touch the line above. +# Everything below will be removed. +diff --git a/modules/compare.py b/modules/compare.py +index 5610357..b9b47f3 100644 +--- a/modules/compare.py ++++ b/modules/compare.py +@@ -97,7 +97,7 @@ def set_against_branch(git_gutter, **kwargs): + message = pieces[0] + branch = pieces[1][11:] # skip 'refs/heads/' + commit = pieces[2][0:7] # 7-digit commit hash +- return [branch, '%s %s' % (commit, message)] ++ return [branch, '%s | %s' % (commit, message)] + + # Create the list of branches to show in the quick panel + items = [parse_result(r) for r in output.split('\n')] diff --git a/Git Files/syntax_test_git_config b/Git Files/syntax_test_git_config new file mode 100644 index 00000000000..a4a97eaf49a --- /dev/null +++ b/Git Files/syntax_test_git_config @@ -0,0 +1,515 @@ +# SYNTAX TEST "Git Config.sublime-syntax" +# <- text.git.config comment.line punctuation.definition.comment + +# COMMENT TEST +# <- comment.line punctuation.definition.comment +#^^^^^^^^^^^^^ comment.line +; this is a comment +# <- comment.line punctuation.definition.comment +#^^^^^^^^^^^^^^^^^^ comment.line + +# SECTION HEADER TESTS +[section] +# <- meta.brackets punctuation.definition.brackets.begin +#^^^^^^^ meta.brackets entity.name +# ^ meta.brackets punctuation.definition.brackets.end +# ^ -meta.brackets +[section "subsection"] +# <- meta.brackets punctuation.definition.brackets.begin +#^^^^^^^^^^^^^ meta.brackets +#^^^^^^^ entity.name +# ^^^^^^^^^^^^ string.quoted.double +# ^ punctuation.definition.string.begin +# ^ punctuation.definition.string.end +# ^ punctuation.definition.brackets.end +[section \"subsection"] +# <- meta.brackets punctuation.definition.brackets.begin +#^^^^^^^^^^^^^ meta.brackets +#^^^^^^^ entity.name +# ^ invalid.illegal +[section "\slashes\are\legal"] +# ^^^^^^^^^^^^^^^^^ string.quoted.double +# ^ punctuation.definition.string.begin +# ^ -invalid.illegal +# ^ -invalid.illegal +# ^ -invalid.illegal +# ^ punctuation.definition.string.end + +[section "slash prevents string from terminating\"] "] # end the test +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double +[sec\tion] +# ^ invalid.illegal +[section "\ "] # escaping a space is legal +# ^ invalid.unnecessary-escape +[section "\\"] +# ^^ constant.character.escape +[section "\""] +# ^^ constant.character.escape +[section "\a"] # every char can be escaped +# ^ invalid.unnecessary-escape +[section "\n"] # every char can be escaped +# ^ invalid.unnecessary-escape + +# LEGACY SECTION HEADER SYNTAX +[section.subsection.subsubsection] +# <- meta.brackets +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.brackets +# ^ - meta.brackets +# <- punctuation.definition.brackets.begin +#^^^^^^^ entity.name.section +# ^ punctuation.accessor.dot +# ^^^^^^^^^^ string.unquoted +# ^ punctuation.accessor.dot +# ^^^^^^^^^^^^^ string.unquoted +# ^ punctuation.definition.brackets.end + +# LEGACY SECTION HEADER SYNTAX +[se\ct\\ion.s"ub\se\\ct\"ion +# <- meta.brackets +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.brackets +# ^ - meta.brackets +# <- punctuation.definition.brackets.begin +#^^ entity.name.section +# ^ invalid.illegal.section-name +# ^^ entity.name.section +# ^^ invalid.illegal.section-name +# ^^^ entity.name.section +# ^ punctuation.accessor.dot +# ^ string.unquoted +# ^ invalid.illegal.subsection-name +# ^^ string.unquoted +# ^ invalid.illegal.subsection-name +# ^^ string.unquoted +# ^^ invalid.illegal.subsection-name +# ^^ string.unquoted +# ^^ invalid.illegal.subsection-name +# ^^^ string.unquoted +# ^ invalid.illegal.unexpected.eol + +# COLOR TESTS +[color "diff"] +# <- meta.brackets punctuation.definition.brackets.begin +#^^^^^^^^^^^^^ meta.brackets +#^^^^^ entity.name +# ^^^^^^ string.quoted.double +# ^ punctuation.definition.string.begin +# ^ punctuation.definition.string.end +# ^ punctuation.definition.brackets.end +# ^ -meta.brackets + old = red +# <- meta.mapping +#^^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ -variable.other.readwrite +# ^ keyword.operator.assignment +# ^ -keyword.operator.assignment +# ^^^ meta.mapping.value support.constant.color + new = #00aa00 # this should be a comment +# <- meta.mapping +#^^^^^^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ -variable.other.readwrite +# ^ keyword.operator.assignment +# ^ -keyword.operator.assignment +# ^ comment.line punctuation.definition.comment +# ^^^^^^^ comment.line + commit = bold yellow +# <- meta.mapping +#^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping +# ^^^^^^ variable.other.readwrite +# ^ -variable.other.readwrite +# ^ keyword.operator.assignment +# ^ -keyword.operator.assignment +# ^^^^^^^^^^^ meta.mapping.value +# ^^^^ support.constant.color-attribute +# ^^^^^^ support.constant.color + commit = yellow 0 +# ^^^^^^ support.constant.color +# ^ constant.other.color.rgb-value + commit = yellow 99 +# ^^^^^^ support.constant.color +# ^^ constant.other.color.rgb-value + commit = yellow 100 +# ^^^^^^ support.constant.color +# ^^^ constant.other.color.rgb-value + commit = yellow 123 +# ^^^^^^ support.constant.color +# ^^^ constant.other.color.rgb-value + commit = yellow 199 +# ^^^^^^ support.constant.color +# ^^^ constant.other.color.rgb-value + commit = yellow 255 +# ^^^^^^ support.constant.color +# ^^^ constant.other.color.rgb-value + commit = yellow255 +# ^^^^^^ -support.constant.color +# ^^^ -constant.other.color.rgb-value + commit = yellow 256 +# ^^^ -constant.other.color.rgb-value + commit = yellow 01 +# ^^ -constant.other.color.rgb-value + commit = yellow 999 +# ^^^ -constant.other.color.rgb-value + +# ESCAPE TESTS +[escapes] + quoted = "\\ \" \b \n \t" +#^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping +# ^^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^^^^^^^^^^^^^^^^ meta.mapping.value string.quoted.double +# ^^ constant.character.escape +# ^^ constant.character.escape +# ^^ constant.character.escape +# ^^ constant.character.escape +# ^^ constant.character.escape + unquoted = \\ \" \b \n \t \ +# ^^ constant.character.escape +# ^^ constant.character.escape +# ^^ constant.character.escape +# ^^ constant.character.escape +# ^^ constant.character.escape +# ^ punctuation.separator.continuation.line + trailing-slash = \ # comments not legal after trailing slash +# ^ invalid.illegal.escape + +# BOOLEAN TESTS +[bools] + foo = true +#^^^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^^^^ meta.mapping.value constant.language + foo = false +#^^^^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^^^^^ meta.mapping.value constant.language + foo = on +#^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^^ meta.mapping.value constant.language + foo = off +#^^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^^^ meta.mapping.value constant.language + foo = no +#^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^^ meta.mapping.value constant.language + foo = yes +#^^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^^^ meta.mapping.value constant.language + +# ILLEGAL NEWLINE IN SECTION TEST +[section +#^^^^^^^^ meta.brackets +#^^^^^^^ entity.name +# ^ invalid.illegal.unexpected.eol +] +# <- punctuation.definition.brackets.end invalid.illegal.stray-bracket +# +# INVALID TEXT AFTER SECTION TEST +[stray-bracket]] and anything # comment +# ^ invalid.illegal.expected.eol +# ^ -invalid.illegal.expected.eol +# ^^^ invalid.illegal.expected.eol +# ^ -invalid.illegal.expected.eol +# ^^^^^^^^ invalid.illegal.expected.eol +# ^ punctuation.definition.comment +# ^^^^^^^^^ comment.line + +# STRAY BRACKET TEST +stray-bracket] +# ^ punctuation.definition.brackets.end invalid.illegal.stray-bracket + +# STRING TESTS +[strings] + foo = "foo" +# ^^^^^ meta.mapping.value string.quoted.double +# ^ punctuation.definition.string.begin +# ^ punctuation.definition.string.end + foo = \"foo\" +# ^^^^^^^ meta.mapping.value +# ^^ constant.character.escape +# ^^^ string.unquoted.value -string.quoted.double +# ^^ constant.character.escape + foo = 'foo' +# ^^^^^ meta.mapping.value string.unquoted.value -string.quoted + foo = \'foo\' +# ^^ invalid.illegal.escape +# ^^^ meta.mapping.value string.unquoted +# ^^ invalid.illegal.escape + foo = foo#bar +# ^^^ meta.mapping.value string.unquoted.value +# ^ punctuation.definition.comment +# ^^^^ comment.line + foo = 'foo#bar' +# ^^^^ string.unquoted.value +# ^ punctuation.definition.comment +# ^^^^^ comment.line + foo = \"foo#bar\" +# ^^ constant.character.escape +# ^^^ string.unquoted.value +# ^ punctuation.definition.comment +# ^^^^^^ comment.line + foo = 'hello#foo' +# ^^^^^^ string.unquoted.value +# ^ punctuation.definition.comment +# ^^^^^ comment.line + foo = 'hello\" +# ^^^^^^ string.unquoted.value +# ^^ constant.character.escape + foo = \ + hello +# ^^^^^ string.unquoted.value + foo = "foo#bar" +# ^ punctuation.definition.string.begin +# ^^^^^^^^^ string.quoted.double +# ^ - punctuation.definition.comment +# ^^^^^ - comment +# ^ punctuation.definition.string.end + foo = #123123 +# ^ punctuation.definition.comment +# ^^^^^^^ comment.line + foo = \hello +# ^^ invalid.illegal.escape + foo = \\hello +# ^^ constant.character.escape +# ^^^^^ string.unquoted.value + foo = hello \ # comments not legal after trailing slash +# ^ invalid.illegal.escape + foo = multi \ +# ^^^^^^^ string.unquoted.value +# ^ punctuation.separator.continuation.line +# ^ -invalid.illegal.unexpected.eol + line +# ^^^^ string.unquoted.value + + foo = "multi\ +# ^ punctuation.separator.continuation.line +# ^ -invalid.illegal.unexpected.eol + line" +# ^^^^^ string.quoted.double +# ^ punctuation.definition.string.end + foo = "invalid +# ^ invalid.illegal.unexpected.eol + multi +# ^ invalid.illegal.unexpected.eol + line +# ^ invalid.illegal.unexpected.eol + " + +# REAL WORLD SAMPLE TESTS +[alias] +# <- meta.brackets punctuation.definition.brackets.begin +#^^^^^^ meta.brackets +#^^^^^ entity.name +# ^ punctuation.definition.brackets.end + branch-author = for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' +# <- meta.mapping +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping +# ^^^^^^^^^^^^^ variable.other.readwrite +# ^ -variable.other.readwrite +# ^ keyword.operator.assignment +# ^ -keyword.operator.assignment +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^^^^^^^^ string.unquoted.value + + fatch = fetch --all --prune --tags +# <- meta.mapping +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping +# ^^^^^ variable.other.readwrite +# ^ -variable.other.readwrite +# ^ keyword.operator.assignment +# ^ -keyword.operator.assignment +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^ string.unquoted.value +# ^^^^^ string.unquoted.value +# ^^^^^^^ string.unquoted.value +# ^^^^^^ string.unquoted.value + lgrep = log -1 -E -i --grep +# <- meta.mapping +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping +# ^^^^^ variable.other.readwrite +# ^ -variable.other.readwrite +# ^ keyword.operator.assignment +# ^ -keyword.operator.assignment +# ^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^ string.unquoted.value +# ^^ string.unquoted.value +# ^^ string.unquoted.value +# ^^ string.unquoted.value +# ^^^^^^ string.unquoted.value + + pushf = push --force-with-lease +# <- meta.mapping +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping +# ^^^^^ variable.other.readwrite +# ^ -variable.other.readwrite +# ^ keyword.operator.assignment +# ^ -keyword.operator.assignment +# ^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^ string.unquoted.value +# ^^^^^^^^^^^^^^^^^^ string.unquoted.value + sla = log --oneline --decorate --graph --all +# <- meta.mapping +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping +# ^^^ variable.other.readwrite +# ^ -variable.other.readwrite +# ^ keyword.operator.assignment +# ^ -keyword.operator.assignment +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^ string.unquoted.value +# ^^^^^^^^^ +# ^^^^^^^^^^ string.unquoted.value +# ^^^^^^^ string.unquoted.value +# ^^^^^ string.unquoted.value + serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git # shell comment +# <- meta.mapping +#^^ meta.mapping +# ^^^^^ meta.mapping.key +# ^^^ meta.mapping +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ keyword.control.import.shell +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell + serve = "!git daemon --reuseaddr --verbose --base-path=. --export-all ./.git" +# <- meta.mapping +#^^ meta.mapping +# ^^^^^ meta.mapping.key +# ^^^ meta.mapping +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ string.quoted.double punctuation.definition.string.begin +# ^ keyword.control.import.shell +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell +# ^^^^^^^^^^^^^^^^^ -source.shell +# ^ string.quoted.double punctuation.definition.string.end +# ^ punctuation.definition.comment +# ^^^^^^^^^^^^^^^ comment.line + impact = !git ls-files -z \ + | xargs -0n1 git blame -w -C # shell comment +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value source.shell + impact = "!git ls-files -z \ + | xargs -0n1 git blame -w -C" # git "comment" +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell +# ^^^^^^^^^^^^^^^^^ - source.shell +# ^ punctuation.definition.comment +# ^^^^^^^^^^^^^^^ comment.line +# check shell script quotation handling + single_quote = "!echo 'This is fine';" +# ^^^^^^^^^^^^ meta.mapping.key +# ^^^ meta.mapping - meta.mapping.key - meta.mapping.value +# ^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^ - meta.mapping +# ^^^^^^^^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ string.quoted.double punctuation.definition.string.begin +# ^ keyword.control.import.shell +# ^ - source.shell +# ^^^^^^^^^^^^^^^^^^^^ source.shell +# ^ - source.shell +# ^ string.quoted.double punctuation.definition.string.end + double_quote = "!echo "This is fine";" +# ^^^^^^^^^^^^ meta.mapping.key +# ^^^ meta.mapping - meta.mapping.key - meta.mapping.value +# ^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^ - meta.mapping +# ^^^^^^^^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ string.quoted.double punctuation.definition.string.begin +# ^ keyword.control.import.shell +# ^ - source.shell +# ^^^^^^^^^^^^^^^^^^^^ source.shell +# ^ - source.shell +# ^ string.quoted.double punctuation.definition.string.end +# check unescaped double quotes within shell script followed by comment with double-quotes + double_quote = "!echo "This is fine";" # with quoted "comment" +# ^^^^^^^^^^^^ meta.mapping.key +# ^^^ meta.mapping - meta.mapping.key - meta.mapping.value +# ^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^^^^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ string.quoted.double punctuation.definition.string.begin +# ^ keyword.control.import.shell +# ^ - source.shell +# ^^^^^^^^^^^^^^^^^^^^ source.shell +# ^ - source.shell +# ^ string.quoted.double punctuation.definition.string.end +# ^ punctuation.definition.comment +# ^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git +# check escaped double quotes within shell script + double_quote = "!echo \"This is fine\";" +# ^^^^^^^^^^^^ meta.mapping.key +# ^^^ meta.mapping - meta.mapping.key - meta.mapping.value +# ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^^^^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ string.quoted.double punctuation.definition.string.begin +# ^ keyword.control.import.shell +# ^ - source.shell +# ^^^^^^^^^^^^^^^^^^^^^^ source.shell +# ^ - source.shell +# ^ string.quoted.double punctuation.definition.string.end +# check escaped double quotes within shell script followed by comment with double-quotes + double_quote = "!echo \"This is fine.\";" # with quoted "comment" +# ^^^^^^^^^^^^ meta.mapping.key +# ^^^ meta.mapping - meta.mapping.key - meta.mapping.value +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^^^^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ string.quoted.double punctuation.definition.string.begin +# ^ keyword.control.import.shell +# ^ - source.shell +# ^^^^^^^^^^^^^^^^^^^^^^^ source.shell +# ^ - source.shell +# ^ string.quoted.double punctuation.definition.string.end +# ^ punctuation.definition.comment +# ^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git + double_quote = "!echo \"This is fine.\"; +# ^^^^^^^^^^^^ meta.mapping.key +# ^^^ meta.mapping - meta.mapping.key - meta.mapping.value +# ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^^^^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ string.quoted.double punctuation.definition.string.begin +# ^ keyword.control.import.shell +# ^ - source.shell +# ^^^^^^^^^^^^^^^^^^^^^^^ source.shell + echo \"This is fine.\";" # with quoted "comment" +# <- meta.mapping.value +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# <- source.shell +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell +# ^ - source.shell +# ^ string.quoted.double punctuation.definition.string.end +# ^ punctuation.definition.comment +# ^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git + double_quote = "!echo "This is fine." ; +# ^^^^^^^^^^^^ meta.mapping.key +# ^^^ meta.mapping - meta.mapping.key - meta.mapping.value +# ^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# ^^^^^^^^^^^^ variable.other.readwrite +# ^ keyword.operator.assignment +# ^ string.quoted.double punctuation.definition.string.begin +# ^ keyword.control.import.shell +# ^ - source.shell +# ^^^^^^^^^^^^^^^^^^^^^^ source.shell + echo "This is fine.";" # with quoted "comment" +# <- meta.mapping.value +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value +# <- source.shell +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell +# ^ - source.shell +# ^ string.quoted.double punctuation.definition.string.end +# ^ punctuation.definition.comment +# ^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git diff --git a/Git Files/syntax_test_git_ignore b/Git Files/syntax_test_git_ignore new file mode 100644 index 00000000000..7bdeaa38bb0 --- /dev/null +++ b/Git Files/syntax_test_git_ignore @@ -0,0 +1,177 @@ +# SYNTAX TEST "Git Ignore.sublime-syntax" +# <- text.git comment.line punctuation.definition.comment + + !~/.fo?d[a-a]r/*.dub +# <- - meta - string +# ^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^ keyword.operator.logical.path.fnmatch.git +# ^ variable.language.environment.home.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git +# ^ - constant +# ^ keyword.operator.path.asterix.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git +# ^ keyword.operator.path.asterix.fnmatch.git +# ^ punctuation.separator.path.extension.fnmatch.git + + ~/../f..o\'ld\"er/fo\*l\?der/fol../der +#^ - entity.name.pattern +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ entity.name.pattern +# ^ variable.language.environment.home.fnmatch.git +# ^^ constant.language.path.parent.fnmatch.git +# ^^ - constant.language.path.parent.fnmatch.git +# ^^ constant.character.escape.path.fnmatch.git +# ^^ constant.character.escape.path.fnmatch.git +# ^ - constant.character.escape.path.fnmatch.git - punctuation.separator.path.fnmatch.git +# ^ keyword.operator.path.asterix.fnmatch.git +# ^ - constant.character.escape.path.fnmatch.git - punctuation.separator.path.fnmatch.git +# ^ keyword.operator.path.asterix.fnmatch.git +# ^^ - constant.language.path.parent.fnmatch.git +# ^ - entity.name.pattern + +# NO HOME pattern + ~fname~1.~e* +# ^^^^^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^ - variable.language.environment.home.fnmatch.git +# ^ - variable.language.environment.home.fnmatch.git +# ^ punctuation.separator.path.extension.fnmatch.git +# ^ - variable.language.environment.home.fnmatch.git +# ^ keyword.operator.path.asterix.fnmatch.git + ~..fname +# ^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^ - variable.language.environment.home.fnmatch.git +# ^^ - constant.language.path.parent.fnmatch.git + ~../fname +# ^^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^ - variable.language.environment.home.fnmatch.git +# ^^ - constant.language.path.parent.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git + +# PARENT DIR TESTS + ../..fname../../ +# ^^^^^^^^^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^^ constant.language.path.parent.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git +# ^^ - constant.language.path.parent.fnmatch.git +# ^^ - constant.language.path.parent.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git +# ^^ constant.language.path.parent.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git + ..fname../.. +# ^^^^^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^^ - constant.language.path.parent.fnmatch.git +# ^^ - constant.language.path.parent.fnmatch.git + +# DRIVE SEPARATOR TESTS + c:/fo:lder:/ +# ^^^^^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^ punctuation.separator.drive.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git +# ^ invalid.illegal.separator.drive.fnmatch.git +# ^ invalid.illegal.separator.drive.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git + cd:/folder +# ^^^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^ invalid.illegal.separator.drive.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git + :/folder +# ^^^^^^^^ string.unquoted.git.ignore entity.name.pattern.git.ignore +# ^ invalid.illegal.separator.drive.fnmatch.git +# ^ punctuation.separator.path.fnmatch.git + + +# CARACTER CLASS TESTS + [ +# ^ meta.char-class.fnmatch.git keyword.control.char-class.begin.fnmatch.git + ] +# ^ string.unquoted.git - keyword.control.char-class + [][]] +# ^^^^ meta.char-class.fnmatch.git +# ^ - meta.char-class.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^^ constant.character.char-class.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ string.unquoted.git - keyword.control.char-class + [^[\]] [^[[] [^]\[] [^]]] [^^][^!] +# ^^^^^^ meta.char-class.fnmatch.git +# ^ - meta.char-class.fnmatch.git +# ^^^^^ meta.char-class.fnmatch.git +# ^ - meta.char-class.fnmatch.git +# ^^^^^^ meta.char-class.fnmatch.git +# ^ - meta.char-class.fnmatch.git +# ^^^^ meta.char-class.fnmatch.git +# ^^ - meta.char-class.fnmatch.git +# ^^^^^^^^ meta.char-class.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^ constant.character.char-class.fnmatch.git - keyword.control.char-class.begin.fnmatch.git +# ^^ constant.character.escape.char-class - keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^^ constant.character.char-class.fnmatch.git - keyword.control.char-class.begin.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^^^ constant.character.char-class.fnmatch.git - keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^ constant.character.char-class.fnmatch.git - keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ string.unquoted.git - keyword.control.char-class +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^ constant.character.char-class.fnmatch.git - keyword.operator +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^ constant.character.char-class.fnmatch.git - keyword.operator +# ^ keyword.control.char-class.end.fnmatch.git + [![\]] [![[] [!]\[] [!]]] [!!][!^] +# ^^^^^^ meta.char-class.fnmatch.git +# ^ - meta.char-class.fnmatch.git +# ^^^^^ meta.char-class.fnmatch.git +# ^ - meta.char-class.fnmatch.git +# ^^^^^^ meta.char-class.fnmatch.git +# ^ - meta.char-class.fnmatch.git +# ^^^^ meta.char-class.fnmatch.git +# ^^ - meta.char-class.fnmatch.git +# ^^^^^^^^ meta.char-class.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^ constant.character.char-class.fnmatch.git - keyword.control.char-class.begin.fnmatch.git +# ^^ constant.character.escape.char-class - keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^^ constant.character.char-class.fnmatch.git - keyword.control.char-class.begin.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^^^ constant.character.char-class.fnmatch.git - keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^ constant.character.char-class.fnmatch.git - keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git +# ^ string.unquoted.git - keyword.control.char-class +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^ constant.character.char-class.fnmatch.git - keyword.operator +# ^ keyword.control.char-class.end.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^ keyword.operator.logical.fnmatch.git +# ^ constant.character.char-class.fnmatch.git - keyword.operator +# ^ keyword.control.char-class.end.fnmatch.git +# The only escape is \]. All other \ are expanded to \\ by fnmatch. + [0123456789abcde-z \t\n\\\"\'./()'-:,.;<>~!@#$%&*|+=\[\]{}`~?] +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.char-class.fnmatch.git +# ^ keyword.control.char-class.begin.fnmatch.git +# ^^^^^^^^^^^^^^^^^ constant.character.char-class.fnmatch.git +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.character.char-class.fnmatch.git +# ^ invalid.illegal.unexpected.char-class.fnmatch.git +# ^^^^^ constant.character.char-class.fnmatch.git +# ^^ constant.character.escape.char-class.fnmatch.git +# ^^^^ constant.character.char-class.fnmatch.git +# ^ invalid.illegal.unexpected.char-class.fnmatch.git +# ^ keyword.control.char-class.end.fnmatch.git diff --git a/Git Files/syntax_test_git_link b/Git Files/syntax_test_git_link new file mode 100644 index 00000000000..6302ea4aa5c --- /dev/null +++ b/Git Files/syntax_test_git_link @@ -0,0 +1,61 @@ +# SYNTAX TEST "Git Link.sublime-syntax" +# <- text.git.link comment.line punctuation.definition.comment +gitdir: c:/data/sublime/packages/.git. +#^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link +# ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link +# ^ - string.unquoted.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.link +# ^ punctuation.separator.drive.git.link +# ^ punctuation.separator.path.git.link +# ^ punctuation.separator.path.git.link +# ^ punctuation.separator.path.git.link +# ^ - string.unquoted.git.link +# ^ punctuation.terminator.path.git.link +gitdir: c:\data\sublime\packages\.git. +#^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link +# ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link +# ^ - string.unquoted.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.link +# ^ punctuation.separator.drive.git.link +# ^ punctuation.separator.path.git.link +# ^ punctuation.separator.path.git.link +# ^ - string.unquoted.git.link +# ^ punctuation.terminator.path.git.link +gitdir: ~/../sub..li~me/./packages/.git +#^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link +# ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link +# <- keyword.other.gitdir.git.link +#^^^^^ keyword.other.gitdir.git.link +# ^ punctuation.separator.mapping.key-value.git.link +# ^ - string.unquoted.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.link +# ^ - string.unquoted.git.link +# ^ variable.language.environment.home.git.link +# ^ punctuation.separator.path.git.link +# ^^ constant.language.path.parent.git.link +# ^ punctuation.separator.path.git.link +# ^^ - constant.language.path.parent.git.link +# ^ - variable.language.environment.home.git.link +# ^ punctuation.separator.path.git.link +# ^ constant.language.path.self.git.link +# ^ punctuation.separator.path.git.link +# ^ - constant.language.path.self.git.link +gitdir invalid : ../data/s?bl*me/packages/.git. +#^^^^^^^^^^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link +# ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link +# <- keyword.other.gitdir.git.link +#^^^^^ keyword.other.gitdir.git.link +# ^^^^^^^ invalid.illegal.separator-expected.git.link +# ^ punctuation.separator.mapping.key-value.git.link +# ^^ constant.language.path.parent.git.link +# ^ punctuation.separator.path.git.link +# ^ punctuation.separator.path.git.link +# ^ invalid.illegal.path.git.link +# ^ invalid.illegal.path.git.link +# ^ punctuation.separator.path.git.link +# ^ punctuation.separator.path.git.link +# ^ punctuation.terminator.path.git.link diff --git a/Git Files/syntax_test_git_log b/Git Files/syntax_test_git_log new file mode 100644 index 00000000000..10ae2b9f95c --- /dev/null +++ b/Git Files/syntax_test_git_log @@ -0,0 +1,46 @@ +# SYNTAX TEST "Git Log.sublime-syntax" +commit e2077c6e006acfd2f060aef03c4ef8f89c4db362 +# <- meta.header.git.commit markup.raw.block.git.log keyword.other.commit.git.log +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.header.git.commit markup.raw.block.git.log +#^^^^^ keyword.other.commit.git.log +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.numeric.hex.hash.git.log +Author: username +# <- meta.header.git.commit markup.raw.block.git.log keyword.other.header.git.log +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.header.git.commit markup.raw.block.git.log +#^^^^^^^ - string.unquoted.log +#^^^^^ keyword.other.header.git.log +# ^ punctuation.separator.mapping.pair.git.log - keyword.other.header.git.log +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.log +# ^ punctuation.definition.reference.email.begin.git +# ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.reference.email.git +# ^^^^^^^^^^^^^^^^^^^^^^^ entity.name.reference.email.git +# ^ punctuation.separator.email.git +# ^ punctuation.definition.reference.email.end.git +Date: Thu Sep 21 22:53:04 2017 +0200 +# <- meta.header.git.commit markup.raw.block.git.log keyword.other.header.git.log +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.header.git.commit markup.raw.block.git.log +#^^^^^^^ - string.unquoted.log +#^^^ keyword.other.header.git.log +# ^ punctuation.separator.mapping.pair.git.log - keyword.other.header.git.log +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.log + +# <- text.git.log - meta.header.git.commit - markup.raw.block.git.log - keyword.other.header.git.log + + Subject of the commit (#433) +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.subject.git.commit +# ^ punctuation.definition.reference.issue.git +# ^^^^ meta.reference.issue.git constant.other.reference.issue.git + - +# ^ invalid.illegal.empty-line-expected.git.commit + The issue #433 was introduced with commit 3ba34d4. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^ punctuation.definition.reference.issue.git +# ^^^^ meta.reference.issue.git constant.other.reference.issue.git + The @username fixed it in user/pulls#230. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.message.git.commit +# ^ punctuation.definition.reference.username.git +# ^^^^^^^^^ meta.reference.username.git entity.name.reference.username.git +# ^^^^^^^^^^^^^^ meta.reference.issue.git constant.other.reference.issue.git +# ^ punctuation.separator.reference.issue.git +# ^ punctuation.definition.reference.issue.git + diff --git a/Git Files/syntax_test_git_merge b/Git Files/syntax_test_git_merge new file mode 100644 index 00000000000..f577e197adc --- /dev/null +++ b/Git Files/syntax_test_git_merge @@ -0,0 +1,14 @@ +# SYNTAX TEST "Git Commit.sublime-syntax" +# <- text.git.commit comment.line punctuation.definition.comment +Merge branch 'pr/git-commit' into add_gitconfig_pkg +# <- meta.subject.git.commit markup.heading.subject.git.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.subject.git.commit markup.heading.subject.git.commit + +# Please enter a commit message to explain why this merge is necessary, +# <- text.git.commit comment.line punctuation.definition.comment +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line +# especially if it merges an updated upstream into a topic branch. + +# +# Lines starting with '#' will be ignored, and an empty message aborts +# the commit. diff --git a/Git Files/syntax_test_git_rebase b/Git Files/syntax_test_git_rebase new file mode 100644 index 00000000000..b8de4bec73a --- /dev/null +++ b/Git Files/syntax_test_git_rebase @@ -0,0 +1,143 @@ +# SYNTAX TEST "Git Rebase.sublime-syntax" +# <- text.git.rebase comment.line punctuation.definition.comment +pick d284bb2 Initial commit +# <- meta.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commit +# ^ -meta.commit +# <- keyword.operator.commit.pick +#^^^ keyword.operator.commit.pick +# ^ -storage.type.commit +# ^^^^^^^ constant.numeric.hex.hash +# ^ -constant.numeric.hex.hash -meta.subject.git.commit +# ^^^^^^^^^^^^^^ meta.subject.git.commit +# ^ -meta.subject.git.commit +p 6746220 Second pick commit # no comment +# <- meta.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commit +# ^ -meta.commit +# <- keyword.operator.commit.pick +#^ -keyword.operator.commit +# ^^^^^^^ constant.numeric.hex.hash +# ^ -constant.numeric.hex.hash -meta.subject.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.subject.git.commit +# ^ -meta.subject.git.commit +# ^^^^ -keyword + p 6746220 Third pick commit # no comment +# <- meta.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commit +# ^ -meta.commit +# ^ -keyword.operator.commit +# ^ keyword.operator.commit.pick +# ^ -keyword.operator.commit -constant.numeric.hex.hash +# ^^^^^^^ constant.numeric.hex.hash +# ^ -constant.numeric.hex.hash -meta.subject.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.subject.git.commit +# ^ -meta.subject.git.commit +# ^^^^ -keyword +puck 6746220 Invalid command +# <- meta.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commit +# <- invalid.illegal.command-expected +#^^^ invalid.illegal.command-expected +# ^ -storage.type.commit -invalid.illegal.command-expected +# ^^^^^^^ constant.numeric.hex.hash +# ^ -constant.numeric.hex.hash -meta.subject.git.commit +# ^^^^^^^^^^^^^^^ meta.subject.git.commit +p 6746x20 Invalid hash # no comment +# <- meta.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commit +# <- keyword.operator.commit.pick +#^ -storage.type.commit +# ^^^^^^^ invalid.illegal.hash-expected +# ^ -constant.numeric.hex.hash -meta.subject.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.subject.git.commit +# ^ -meta.subject.git.commit +a 6746x20 Invalid command and hash # no comment (#403) +# <- meta.commit +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commit +# <- invalid.illegal.command-expected +#^ -storage.type.commit +# ^^^^^^^ invalid.illegal.hash-expected +# ^ -constant.numeric.hex.hash -meta.subject.git.commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.subject.git.commit +# ^ punctuation.definition.reference.issue.git +# ^^^^ meta.reference.issue.git constant.other.reference.issue.git +# ^ -meta.subject.git.commit + # p 6746220 Second pick commit # no comment +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.rebase + d d284bb2 Drop commit +# ^ keyword.operator.commit.drop + drop d284bb2 Drop commit +# ^^^^ keyword.operator.commit.drop + e d284bb2 Edit commit +# ^ keyword.operator.commit.edit + edit d284bb2 Edit commit +# ^^^^ keyword.operator.commit.edit + x d284bb2 Execute command +# ^ keyword.operator.commit.exec + exec d284bb2 Execute command +# ^^^^ keyword.operator.commit.exec + f d284bb2 Fixup commit +# ^ keyword.operator.commit.fixup + fixup d284bb2 Fixup commit +# ^^^^^ keyword.operator.commit.fixup + r d284bb2 Reword commit +# ^ keyword.operator.commit.reword + reword d284bb2 Reword commit +# ^^^^^^ keyword.operator.commit.reword + +# Rebase 9e73d21..6746220 onto 9e73d21 (2 commands) +# <- comment.line punctuation.definition.comment +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line meta.rebase-msg +# ^^^^^^^ constant.numeric.hex.hash +# ^^ punctuation.separator.commit-range +# ^^^^^^^ constant.numeric.hex.hash +# ^^^^^^^ constant.numeric.hex.hash +# +# Commands: +#^^^^^^^^^^^ comment.line.git.rebase +# ^^^^^^^^ markup.heading.git.rebase +# p, pick = use commit +#^^^^^^^^^^^^^^^^^^^^^^ comment.line +# ^^^^^^^^^^^^^^^^^^^^ meta.commands-help.pick +#^ - keyword.operator +# ^ keyword.operator.commit.pick +# ^^ - keyword.operator +# ^ punctuation.separator.sequence +# ^^^^ keyword.operator.commit.pick +# ^^^^^^^^^^^^^ - keyword.operator +# ^ punctuation.separator.mapping.pair +# ^^^^^^^^^^ - string.unquoted +# ^^^^^^^^^^ string.unquoted +# r, reword = use commit, but edit the commit message +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commands-help.reword +# ^ keyword.operator.commit.reword +# ^^^^^^ keyword.operator.commit.reword +# e, edit = use commit, but stop for amending +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commands-help.edit +# ^ keyword.operator.commit.edit +# ^^^^ keyword.operator.commit.edit +# s, squash = use commit, but meld into previous commit +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commands-help.squash +# ^ keyword.operator.commit.squash +# ^^^^^^ keyword.operator.commit.squash +# f, fixup = like "squash", but discard this commit's log message +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commands-help.fixup +# ^ keyword.operator.commit.fixup +# ^^^^^ keyword.operator.commit.fixup +# x, exec = run command (the rest of the line) using shell +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commands-help.exec +# ^ keyword.operator.commit.exec +# ^^^^ keyword.operator.commit.exec +# d, drop = remove commit +# ^^^^^^^^^^^^^^^^^^^^^^^ meta.commands-help.drop +# ^ keyword.operator.commit.drop +# ^^^^ keyword.operator.commit.drop +# +# These lines can be re-ordered; they are executed from top to bottom. +# +# If you remove a line here THAT COMMIT WILL BE LOST. +# +# However, if you remove everything, the rebase will be aborted. +# +# Note that empty commits are commented out diff --git a/Git Files/syntax_test_git_tag b/Git Files/syntax_test_git_tag new file mode 100644 index 00000000000..f8400510a9d --- /dev/null +++ b/Git Files/syntax_test_git_tag @@ -0,0 +1,11 @@ +# SYNTAX TEST "Git Commit.sublime-syntax" +# <- text.git.commit comment.line punctuation.definition.comment +Release v0.0.2 +# <- meta.subject.git.commit markup.heading.subject.git.commit +#^^^^^^^^^^^^^ meta.subject.git.commit markup.heading.subject.git.commit + +# Write a message for tag: +# <- text.git.commit comment.line punctuation.definition.comment +#^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line +# v0.0.2 +# Lines starting with '#' will be ignored.