diff --git a/Diff/Diff (Basic).sublime-syntax b/Diff/Diff (Basic).sublime-syntax new file mode 100644 index 0000000000..0a83f85151 --- /dev/null +++ b/Diff/Diff (Basic).sublime-syntax @@ -0,0 +1,188 @@ +%YAML 1.2 +--- +# This is the common base syntax for Gnu Diff and Git Diff, +# which contains contexts, shared by both of them. +# It is not designed as standalone syntax and therefore does not expose +# anything when referenced or used directly. +# +# https://www.sublimetext.com/docs/syntax.html +# https://www.gnu.org/software/diffutils/manual/diffutils.html +scope: source.diff.basic +version: 2 +hidden: true + +contexts: + main: [] + +###[ HEADERS ]################################################################# + + diff-header: + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Detailed-Unified + - match: ^(-{3})[ ](?!$) + captures: + 1: punctuation.definition.from-file.diff + push: diff-header-unified-from-file + - match: ^(\+{3})[ ](?!$) + captures: + 1: punctuation.definition.to-file.diff + push: diff-header-unified-to-file + + diff-header-unified-from-file: + - meta_scope: meta.diff.header.from-file meta.header.from-file.diff + - include: pop-eol + - include: dev-null + - include: path-separators + - include: timestamps + - include: diff-header-unified-file-comment + + diff-header-unified-to-file: + - meta_scope: meta.diff.header.to-file meta.header.to-file.diff + - include: pop-eol + - include: dev-null + - include: path-separators + - include: timestamps + - include: diff-header-unified-file-comment + + diff-header-unified-file-comment: + - match: \s+(\(.+\))$ + captures: + 1: comment.block.diff + +###[ RANGES ]################################################################## + + diff-line-ranges: + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Detailed-Unified + - match: ^(@@)(?=[^@\n]+@@(?:\s|$)) + captures: + 1: punctuation.definition.range.begin.diff + push: [hunk-name, inside-diff-line-ranges-unified] + + inside-diff-line-ranges-unified: + - meta_scope: meta.diff.range.unified meta.range.unified.diff meta.toc-list.hunk.diff + - include: pop-eol + - match: \1 + scope: punctuation.definition.range.end.diff + pop: 1 + - include: line-range-span + - match: '[+-](?=\d)' + scope: support.function.diff + + hunk-name: + - include: pop-eol + - match: '[ \t]+' + scope: meta.toc-list.hunk.diff + - match: \S.+?(?=\s*{{eol}}) + scope: meta.toc-list.hunk.diff entity.name.section.diff + + line-range-span: + - match: \d+(?:(,)\d+)? + captures: + 1: punctuation.separator.sequence.diff + +###[ DELTAS ]################################################################## + + diff-deltas: + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Unified + - match: ^\+ + scope: punctuation.definition.inserted.diff + push: line-inserted + - match: ^- + scope: punctuation.definition.deleted.diff + push: line-deleted + - include: incomplete-line + + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Incomplete-Lines + incomplete-line: + - match: ^[\\/] + scope: punctuation.definition.comment.begin.diff + push: line-ignored + + line-deleted: + - meta_scope: markup.deleted.diff + - include: pop-eol + - include: trailing-whitespace + + line-inserted: + - meta_scope: markup.inserted.diff + - include: pop-eol + - include: trailing-whitespace + + line-changed: + - meta_scope: markup.changed.diff + - include: pop-eol + - include: trailing-whitespace + + line-ignored: + - meta_scope: comment.line.diff + - include: pop-eol + - include: trailing-whitespace + + trailing-whitespace: + - match: '[ \t]*$' + scope: meta.whitespace.trailing.diff + +###[ COMPONENTS ]############################################################## + + dev-null: + - match: /dev/null\b + scope: constant.language.null.diff + + path-separators: + - match: /|\\ + scope: punctuation.separator.path.diff + - match: \B\.\.(?=/|\\) + scope: constant.other.path.parent.diff + - match: \B\.(?=/|\\) + scope: constant.other.path.self.diff + + timestamps: + # 1970-01-01 00:00:00 +0000 + - match: \b1970(-)01(-)01 0?0(:)00(:)00(?:(\.)0+)?(?:[ ]([+-]?0000|UTC))? + scope: meta.date.diff constant.language.null.diff + captures: + 1: punctuation.separator.date.diff + 2: punctuation.separator.date.diff + 3: punctuation.separator.date.diff + 4: punctuation.separator.date.diff + 5: punctuation.separator.decimal.diff + 6: storage.modifier.diff + + # 2002-02-21 23:30:50.442260588 -0800 + - match: \b\d{4}(-)\d\d(-)\d\d \d?\d(:)\d\d(:)\d\d(?:(\.)\d+)?(?:[ ]([+-]?\d{4}))? + scope: meta.date.diff meta.number.integer.decimal.diff constant.numeric.value.diff + captures: + 1: punctuation.separator.date.diff + 2: punctuation.separator.date.diff + 3: punctuation.separator.date.diff + 4: punctuation.separator.date.diff + 5: punctuation.separator.decimal.diff + 6: storage.modifier.diff + +###[ PROTOTYPES ]############################################################## + + pop-immediately: + - match: '' + pop: 1 + + pop-eol: + - match: '{{eol}}' + pop: 1 + + pop-before-eol: + - match: $ + pop: 1 + +############################################################################### + +variables: + git_hash40: '[0-9a-fA-F]{40}' + git_hash64: '[0-9a-fA-F]{64}' + git_hash_full: (?:{{git_hash64}}|{{git_hash40}}) + git_first_line: |- + ^(?x: + From [ ] \w+@z [ ] + Thu [ ] Jan [ ]{2} 1 [ ] 00:00:00 [ ] 1970 # git-send-email + | From [ ] {{git_hash_full}} [ ] + Mon [ ] Sep [ ] 17 [ ] 00:00:00 [ ] 2001 # git-format-patch + ) + eol: (?:$\n?) diff --git a/Diff/Diff.sublime-syntax b/Diff/Diff.sublime-syntax index 2856da0f85..ea3a8e190d 100644 --- a/Diff/Diff.sublime-syntax +++ b/Diff/Diff.sublime-syntax @@ -1,75 +1,358 @@ %YAML 1.2 --- -# http://www.sublimetext.com/docs/3/syntax.html +# https://www.sublimetext.com/docs/syntax.html +# https://www.gnu.org/software/diffutils/manual/diffutils.html name: Diff +scope: source.diff +version: 2 + +extends: Diff (Basic).sublime-syntax + file_extensions: - diff - patch + first_line_match: |- - (?x)^ - (===\ modified\ file - |==== \s* // .+ \s - \s .+ \s+ ==== - |Index:[ ] - |---\ [^%] - |\*\*\*.*\d{4}\s*$ - |\d+(,\d+)* (a|d|c) \d+(,\d+)* $ - |diff\ --git[ ] - ) + ^(?x: + ===\ modified\ file + | ==== \s* // .+ \s - \s .+ \s+ ==== + | Index:[ ] + | Prereq:[ ] + | ---\ [^%] + | \*\*\*.*\d{4}\s*$ + | \d+(,\d+)* [adc] \d+(,\d+)* $ + ) -scope: source.diff contexts: main: - - match: '^((\*{15})|(={67})|(-{3}))$\n?' + - match: ^(?={{git_first_line}}) + embed: Packages/Git Formats/Git Diff.sublime-syntax#email-first-line + escape: (?!) + # Hack for unit tests + - include: incomplete-line + - match: ^ + push: diffs + + diffs: + - include: diff-line-ranges + - include: diff-header + - include: conflicts + - include: diff-deltas + - include: diff3-edit + - include: diff3-normal + - include: side-by-side + +###[ HEADERS ]################################################################# + + diff-header: + - meta_prepend: true + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Detailed-Context + - match: ^(\*{15}){{eol}} scope: meta.separator.diff captures: - 1: punctuation.definition.separator.diff - - match: ^\d+(,\d+)*(a|d|c)\d+(,\d+)*$\n? - scope: meta.diff.range.normal meta.range.normal.diff - - match: ^(@@)\s*(.+?)\s*(@@)\s*(.*?)\s*$\n? - scope: meta.diff.range.unified meta.range.unified.diff - captures: - 1: punctuation.definition.range.diff - 2: meta.toc-list.line-number.diff - 3: punctuation.definition.range.diff - 4: entity.name.section.diff - - match: '^(((\-{3}) .+ (\-{4}))|((\*{3}) .+ (\*{4})))$\n?' - scope: meta.diff.range.context meta.range.context.diff - captures: - 3: punctuation.definition.range.diff - 4: punctuation.definition.range.diff - 6: punctuation.definition.range.diff - 7: punctuation.definition.range.diff - - match: '(^(((-{3}) .+)|((\*{3}) .+))$\n?|^(={4}) .+(?= - ))' + 1: punctuation.separator.block.diff + - match: ^(\*{3})[ ](?!$) + captures: + 1: punctuation.definition.from-file.diff + push: diff-header-context-from-file + + # https://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn.c.patch + - match: ^(={67}|={78}|_{67}){{eol}} + scope: meta.separator.diff + captures: + 1: punctuation.separator.block.diff + + # File headers from extensions and SVN + - match: |- + ^(?x:( + Added | Copied | Deleted | Index | Modified + | Prereq | Property [ ] changes [ ] on + ))(:)[ \t]* + captures: + 1: meta.mapping.key.diff keyword.other.diff + 2: punctuation.separator.key-value.diff + push: diff-header-index-file-body + + # Can't find documentation for these "="-formatted headers, but there + # are preexisting unit tests. + - match: ^(={4}) .+(?= - ) scope: meta.diff.header.from-file meta.header.from-file.diff captures: - 4: punctuation.definition.from-file.diff - 6: punctuation.definition.from-file.diff - 7: punctuation.definition.from-file.diff - - match: '(^(\+{3}) .+$\n?| (-) .* (={4})$\n?)' - scope: meta.diff.header.to-file meta.header.to-file.diff + 1: punctuation.definition.from-file.diff + push: diff-header-4equals-body + + diff-header-index-file-body: + - meta_scope: meta.mapping.diff meta.diff.index meta.index.diff + - meta_content_scope: meta.mapping.value.diff meta.toc-list.file-name.diff + - include: pop-eol + - include: path-separators + + diff-header-4equals-body: + - match: ( (-) )(.* (={4})){{eol}} captures: - 2: punctuation.definition.to-file.diff - 3: punctuation.definition.to-file.diff + 1: meta.header.diff + 2: punctuation.separator.range.diff + 3: meta.diff.header.to-file meta.header.to-file.diff 4: punctuation.definition.to-file.diff - - match: ^(?:(>)(?:\ .*?)?|(\+).*?)(\s*?)$\n? - scope: markup.inserted.diff + pop: 1 + - include: pop-immediately + + diff-header-context-from-file: + - meta_scope: meta.diff.header.from-file meta.header.from-file.diff + - match: '{{eol}}' + set: maybe-diff-header-context-to-file + - include: dev-null + - include: path-separators + - include: timestamps + + maybe-diff-header-context-to-file: + - match: ^(-{3})[ ](?!$) captures: - 1: punctuation.definition.inserted.diff - 2: punctuation.definition.inserted.diff - 3: meta.whitespace.trailing.diff - - match: ^(!).*?(\s*?)$\n? - scope: markup.changed.diff + 1: punctuation.definition.to-file.diff + push: diff-header-context-to-file + - match: ^ + pop: 1 + + diff-header-context-to-file: + - meta_scope: meta.diff.header.to-file meta.header.to-file.diff + - include: pop-eol + - include: dev-null + - include: path-separators + - include: timestamps + +###[ RANGES ]################################################################## + + diff-line-ranges: + - meta_prepend: true + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Hunks + - match: ^-{3}{{eol}} + scope: meta.separator.diff punctuation.separator.block.diff + - match: ^\d+(?:(,)\d+)*(a|d|c)\d+(?:(,)\d+)*{{eol}} + scope: meta.diff.range.normal meta.range.normal.diff + captures: + 1: punctuation.separator.range.diff + 2: support.function.diff + 3: punctuation.separator.range.diff + + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Context + - match: ^(-){3}(?= .+ -{4}{{eol}}) + scope: punctuation.definition.range.begin.diff + push: inside-diff-line-ranges-context + - match: ^(\*){3}(?= .+ \*{4}{{eol}}) + scope: punctuation.definition.range.begin.diff + push: inside-diff-line-ranges-context + + inside-diff-line-ranges-context: + - meta_scope: meta.diff.range.context meta.range.context.diff meta.toc-list.hunk.diff + - include: pop-eol + - match: \1{4} + scope: punctuation.definition.range.end.diff + pop: 1 + - include: line-range-span + +###[ DELTAS ]################################################################## + + diff-deltas: + - meta_prepend: true + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Normal + - match: ^> ? + scope: punctuation.definition.inserted.diff + push: line-inserted + - match: ^< ? + scope: punctuation.definition.deleted.diff + push: line-deleted + + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Context + - match: ^\+ ? + scope: punctuation.definition.inserted.diff + push: line-inserted + - match: ^- ? + scope: punctuation.definition.deleted.diff + push: line-deleted + - match: ^! ? + scope: punctuation.definition.changed.diff + push: line-changed + +###[ DIFF3 ]################################################################### + + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-diff3-Normal + diff3-normal: + - match: ^====([1-3]?){{eol}} + scope: meta.hunk.diff punctuation.section.hunk.diff + captures: + 1: constant.numeric.from-file.diff + + - match: ^(([1-3])(:)(?:\d+(a)|\d+(?:(,)\d+)?(c))){{eol}} + scope: meta.diff.range.normal meta.range.normal.diff + captures: + 1: meta.toc-list.hunk.diff + 2: constant.numeric.from-file.diff + 3: punctuation.separator.file.diff + 4: support.function.diff + 5: punctuation.separator.range.diff + 6: support.function.diff + push: diff3-normal-change + + diff3-normal-change: + - meta_scope: meta.hunk.diff + - meta_content_scope: meta.block.diff + - match: ^(?:\t| ) + push: line-changed + - match: ^ + pop: 1 + + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Selecting-Which-Changes-to-Incorporate + diff3-edit: + - match: ^(\d+)(a){{eol}} captures: - 1: punctuation.definition.changed.diff - 2: meta.whitespace.trailing.diff - - match: ^(?:(<)(?:\ .*?)?|(-).*?)(\s*?)$\n? - scope: markup.deleted.diff + 1: meta.diff.range.normal meta.range.normal.diff + 2: support.function.diff + push: diff3-edit-inserted + + - match: ^(\d+)(d){{eol}} + captures: + 1: meta.diff.range.normal meta.range.normal.diff + 2: support.function.diff + push: diff3-edit-deleted + + - match: ^(\d+)(c){{eol}} captures: - 1: punctuation.definition.deleted.diff + 1: meta.diff.range.normal meta.range.normal.diff + 2: support.function.diff + push: diff3-edit-changed + + diff3-edit-inserted: + - meta_scope: meta.hunk.diff + - meta_content_scope: meta.block.diff markup.inserted.diff + - include: diff3-edit-end + + diff3-edit-deleted: + - meta_scope: meta.hunk.diff + - meta_content_scope: meta.block.diff markup.deleted.diff + - include: diff3-edit-end + + diff3-edit-changed: + - meta_scope: meta.hunk.diff + - meta_content_scope: meta.block.diff markup.changed.diff + - include: diff3-edit-end + + diff3-edit-end: + - match: ^\.$ + scope: punctuation.terminator.hunk.diff + pop: 1 + +###[ CONFLICTS ]############################################################### + + # Utility context for other files to use + conflict-markers: + - match: ^({{conflict_any}})\s*({{conflict_identifier}})\s*{{eol}} + captures: + 1: punctuation.section.block.diff + 2: entity.name.section.diff + + conflicts: + - match: ^(?={{conflict_begin}}) + push: + - conflict + - conflict-marker-start + + conflict: + - meta_scope: meta.block.conflict.diff + - match: '' + pop: 1 + + conflict-marker-start: + - match: '{{conflict_begin}}' + scope: punctuation.section.block.begin.diff + - match: (?:({{conflict_identifier}})\s*)?{{eol}} + captures: + 1: entity.name.section.diff + set: conflict-deleted-lines + + conflict-base-marker-start: + - match: '{{conflict_base}}' + scope: punctuation.section.block.diff + - match: (?:({{conflict_identifier}})\s*)?{{eol}} + captures: + 1: entity.name.section.diff + set: conflict-base-lines + + conflict-split-marker-start: + - match: '{{conflict_split}}' + scope: punctuation.section.block.diff + - match: (?:({{conflict_identifier}})\s*)?{{eol}} + captures: + 1: entity.name.section.diff + set: conflict-new-lines + + conflict-deleted-lines: + - meta_content_scope: markup.deleted.diff + - match: ^(?={{conflict_base}}) + set: conflict-base-marker-start + - match: ^(?={{conflict_split}}) + set: conflict-split-marker-start + - include: invalid-conflict-marker + + conflict-base-lines: + - meta_content_scope: comment.block.diff + - match: ^(?={{conflict_split}}) + set: conflict-split-marker-start + - include: invalid-conflict-marker + + conflict-new-lines: + - meta_content_scope: markup.inserted.diff + - match: ^({{conflict_end}})\s*(?:({{conflict_identifier}})\s*)?{{eol}} + captures: + 1: punctuation.section.block.end.diff + 2: entity.name.section.diff + pop: 1 + # Nested conflicts in Git ReReRe + - include: conflicts + - include: invalid-conflict-marker + + invalid-conflict-marker: + - match: ^(?:{{conflict_any}}) + scope: invalid.illegal.conflict.diff + +###[ SIDE-BY-SIDE ]############################################################ + + # https://www.gnu.org/software/diffutils/manual/diffutils.html#Side-by-Side + side-by-side: + - match: ^(.*) (<)$ + captures: + 1: markup.deleted.diff 2: punctuation.definition.deleted.diff - 3: meta.whitespace.trailing.diff - - match: ^Index(:) (.+)$\n? - scope: meta.diff.index meta.index.diff + - match: ^(.*) (\()$ captures: - 1: punctuation.separator.key-value.diff - 2: meta.toc-list.file-name.diff + 1: comment.line.diff + 2: punctuation.definition.deleted.diff + - match: ^(.*) ([\\|/]) (.*)$ + captures: + 1: markup.changed.diff + 2: punctuation.definition.changed.diff + 3: markup.changed.diff + - match: '^ {4,}(>)(?: (.*))?$' + captures: + 1: punctuation.definition.inserted.diff + 2: markup.inserted.diff + - match: '^ {4,}(\))(?: (.*))?$' + captures: + 1: punctuation.definition.inserted.diff + 2: comment.line.diff + +############################################################################### + +variables: + conflict_begin: <{5,} + conflict_end: '>{5,}' + conflict_split: ={5,} + conflict_base: \|{5,} + conflict_any: |- + (?x: + {{conflict_begin}} + | {{conflict_end}} + | {{conflict_split}} + | {{conflict_base}} + ) + + conflict_identifier: (?:\S.*?) diff --git a/Diff/syntax_test_diff.diff b/Diff/syntax_test_diff.diff deleted file mode 100644 index e2e0550f6f..0000000000 --- a/Diff/syntax_test_diff.diff +++ /dev/null @@ -1,101 +0,0 @@ -# SYNTAX TEST "Packages/Diff/Diff.sublime-syntax" - ---- Path to Original File -#^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.from-file meta.header.from-file.diff -# <- punctuation.definition.from-file.diff -#^^ punctuation.definition.from-file.diff - -+++ Path to Modified File -#^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.to-file meta.header.to-file.diff -# <- punctuation.definition.to-file.diff -#^^ punctuation.definition.to-file.diff - -28a211 -#^^^^^ meta.diff.range.normal meta.range.normal.diff - -@@ -2,8 +2,11 @@ -#^^^^^^^^^^^^^^^ meta.diff.range.unified meta.range.unified.diff -# <- punctuation.definition.range.diff -#^ punctuation.definition.range.diff -# ^ - punctuation -# ^^^^^^^^^^ meta.toc-list.line-number.diff -# ^ - punctuation -# ^^ punctuation.definition.range.diff -# ^ - entity - punctuation - -@@ -2,8 +2,11 @@ function_hint(int var) -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.range.unified meta.range.unified.diff -# <- punctuation.definition.range.diff -#^ punctuation.definition.range.diff -# ^ - punctuation -# ^^^^^^^^^^ meta.toc-list.line-number.diff -# ^ - punctuation -# ^^ punctuation.definition.range.diff -# ^ - entity - punctuation -# ^^^^^^^^^^^^^^^^^^^^^^ entity.name.section.diff -# ^ - entity.name.section.diff - ---- Range ---- -#^^^^^^^^^^^^^ meta.diff.range.context meta.range.context.diff -# <- punctuation.definition.range.diff -#^^ punctuation.definition.range.diff -# ^^^^ punctuation.definition.range.diff - -*** Range **** -#^^^^^^^^^^^^^ meta.diff.range.context meta.range.context.diff -# <- punctuation.definition.range.diff -#^^ punctuation.definition.range.diff -# ^^^^ punctuation.definition.range.diff - -*************** -#^^^^^^^^^^^^^^ meta.separator.diff punctuation.definition.separator.diff - -**************** -#^^^^^^^^^^^^^^^ -meta.separator.diff punctuation.definition.separator.diff - -=================================================================== -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.diff punctuation.definition.separator.diff - -==================================================================== -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -meta.separator.diff punctuation.definition.separator.diff - ---- -#^^ meta.separator.diff -#^^ punctuation.definition.separator.diff - ----- -#^^^ -meta.separator.diff -#^^^ -punctuation.definition.separator.diff - -Plain Text -#^^^^^^^^^ source.diff - -+ Addition -# <- markup.inserted.diff punctuation.definition.inserted.diff -# ^^^^^^^^ markup.inserted.diff - meta.whitespace -# ^^ markup.inserted.diff meta.whitespace.trailing.diff - -> Addition -# <- markup.inserted.diff punctuation.definition.inserted.diff -# ^^^^^^^^ markup.inserted.diff - meta.whitespace -# ^^ markup.inserted.diff meta.whitespace.trailing.diff - -- Deletion -# <- markup.deleted.diff punctuation.definition.deleted.diff -# ^^^^^^^^ markup.deleted.diff - meta.whitespace -# ^^ markup.deleted.diff meta.whitespace.trailing.diff - -< Deletion -# <- markup.deleted.diff punctuation.definition.deleted.diff -# ^^^^^^^^ markup.deleted.diff - meta.whitespace -# ^^ markup.deleted.diff meta.whitespace.trailing.diff - -! Modified -# <- markup.changed.diff punctuation.definition.changed.diff -# ^^^^^^^^ markup.changed.diff - meta.whitespace -# ^^ markup.changed.diff meta.whitespace.trailing.diff - -Index: value -#^^^^^^^^^^^ meta.diff.index meta.index.diff -# ^ punctuation.separator.key-value.diff -# ^^^^^ meta.toc-list.file-name.diff diff --git a/Diff/tests/syntax_test_diff.diff b/Diff/tests/syntax_test_diff.diff new file mode 100644 index 0000000000..582560a4f3 --- /dev/null +++ b/Diff/tests/syntax_test_diff.diff @@ -0,0 +1,597 @@ +\ SYNTAX TEST "Packages/Diff/Diff.sublime-syntax" + +--- Path to Original File +\^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.from-file meta.header.from-file.diff - source.diff.git +\ <- punctuation.definition.from-file.diff +\^^ punctuation.definition.from-file.diff + ++++ Path to Modified File +\^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.to-file meta.header.to-file.diff +\ <- punctuation.definition.to-file.diff +\^^ punctuation.definition.to-file.diff + +28a211 +\^^^^^ meta.diff.range.normal meta.range.normal.diff + +@@ -2,8 +2,11 @@ +\^^^^^^^^^^^^^^^ meta.diff.range.unified meta.range.unified.diff +\ <- punctuation.definition.range.begin.diff +\^ punctuation.definition.range.begin.diff +\ ^ - punctuation +\ ^^^^^^^^^^ meta.toc-list.hunk.diff +\ ^ - punctuation +\ ^^ punctuation.definition.range.end.diff +\ ^ - entity - punctuation + +@@ -2,8 +2,11 @@ function_hint(int var) +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list.hunk.diff +\^^^^^^^^^^^^^^^ meta.diff.range.unified meta.range.unified.diff +\ <- punctuation.definition.range.begin.diff +\^ punctuation.definition.range.begin.diff +\ ^ - punctuation +\ ^ - punctuation +\ ^^ punctuation.definition.range.end.diff +\ ^ - entity - punctuation +\ ^^^^^^^^^^^^^^^^^^^^^^ entity.name.section.diff +\ ^ - entity.name.section.diff + +==== From-File - To-File ==== +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.header +\^^^^^^^^^^^^^ meta.header.from-file.diff +\^^^ punctuation.definition.from-file.diff +\ ^^^^^^^^^^^^ meta.header.to-file.diff +\ ^ punctuation +\ ^^^^ punctuation.definition.to-file.diff + +--- Range ---- +\^^^^^^^^^^^^^ meta.diff.range.context meta.range.context.diff +\ <- punctuation.definition.range.begin.diff +\^^ punctuation.definition.range.begin.diff +\ ^^^^ punctuation.definition.range.end.diff + +*** Range **** +\^^^^^^^^^^^^^ meta.diff.range.context meta.range.context.diff +\ <- punctuation.definition.range.begin.diff +\^^ punctuation.definition.range.begin.diff +\ ^^^^ punctuation.definition.range.end.diff + +*************** +\^^^^^^^^^^^^^^ meta.separator.diff punctuation.separator.block.diff + +**************** +\^^^^^^^^^^^^^^^ - meta - punctuation + +=================================================================== +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.diff punctuation.separator.block.diff + +==================================================================== +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta - punctuation + +--- +\^^ meta.separator.diff +\^^ punctuation.separator.block.diff + +---- +\^^^ - meta - punctuation + +Plain Text +\^^^^^^^^^ source.diff - markup + ++ Addition +\ <- punctuation.definition.inserted.diff +\ ^^^^^^^^ markup.inserted.diff - meta.whitespace +\ ^^ markup.inserted.diff meta.whitespace.trailing.diff + +> Addition +\ <- punctuation.definition.inserted.diff +\ ^^^^^^^^ markup.inserted.diff - meta.whitespace +\ ^^ markup.inserted.diff meta.whitespace.trailing.diff + +- Deletion +\ <- punctuation.definition.deleted.diff +\ ^^^^^^^^ markup.deleted.diff - meta.whitespace +\ ^^ markup.deleted.diff meta.whitespace.trailing.diff + +< Deletion +\ <- punctuation.definition.deleted.diff +\ ^^^^^^^^ markup.deleted.diff - meta.whitespace +\ ^^ markup.deleted.diff meta.whitespace.trailing.diff + +! Modified +\ <- punctuation.definition.changed.diff +\ ^^^^^^^^ markup.changed.diff - meta.whitespace +\ ^^ markup.changed.diff meta.whitespace.trailing.diff + +Index: lao +\^^^^^^^^^^ meta.diff.index meta.index.diff +\^^^^ meta.mapping.key.diff keyword.other.diff +\ ^ punctuation.separator.key-value.diff +\ ^^^ meta.mapping.value.diff meta.toc-list.file-name.diff + +\ No newline at end of file +\^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line +\ <- punctuation.definition.comment + + +Normal Format https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Normal +1,2d0 +\ <- meta.diff.range.normal meta.range.normal.diff +\^^^^ meta.diff.range.normal meta.range.normal.diff +\^ punctuation.separator.range.diff +\ ^ support.function.diff +< The Way that can be told of is not the eternal Way; +< The name that can be named is not the eternal name. +4c2,3 +\ <- meta.diff.range.normal meta.range.normal.diff +\^^^^ meta.diff.range.normal meta.range.normal.diff +\^ support.function.diff +\ ^ punctuation.separator.range.diff +< The Named is the mother of all things. +\ <- markup.deleted.diff punctuation.definition.deleted.diff +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.deleted.diff +\^ punctuation.definition.deleted.diff +--- +\ <- meta.separator.diff punctuation.separator.block.diff +\^^ meta.separator.diff punctuation.separator.block.diff +> The named is the mother of all things. +> +\^ - meta.whitespace +11a11,13 +\ <- meta.diff.range.normal meta.range.normal.diff +\^^^^^^^ meta.diff.range.normal meta.range.normal.diff +\ ^ support.function.diff +\ ^ punctuation.separator.range.diff +> They both may be called deep and profound. +> Deeper and more profound, +> The door of all subtleties! +\ <- markup.inserted.diff punctuation.definition.inserted.diff +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.inserted.diff +\^ punctuation.definition.inserted.diff + + +Context Format https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Context +*** lao 2002-02-21 23:30:39.942229878 -0800 +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.header.from-file +\^^ punctuation.definition.from-file +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.number + +\ Only consider `---` to be a "to" if it follows a `***` +*** lao 2002-02-21 23:30:39.942229878 -0800 +--- tzu 2002-02-21 23:30:50.442260588 -0800 +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.header.to-file +\^^ punctuation.definition.to-file +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.number +*************** +\^^^^^^^^^^^^^^ meta.separator.diff punctuation.separator.block.diff +*** 1,7 **** +\^^^^^^^^^^^ meta.diff.range.context meta.range.context.diff +\ ^ punctuation.separator +\^^ punctuation.definition.range.begin.diff +\ ^^^^ punctuation.definition.range.end.diff +- The Way that can be told of is not the eternal Way; +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.deleted.diff +\ <- punctuation.definition.deleted.diff +- The name that can be named is not the eternal name. +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.deleted.diff +\ <- punctuation.definition.deleted.diff + The Nameless is the origin of Heaven and Earth; +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - markup +! The Named is the mother of all things. +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.changed.diff +\ <- punctuation.definition.changed.diff + Therefore let there always be non-being, +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - markup + so we may see their subtlety, + And let there always be being, +--- 1,6 ---- +\^^^^^^^^^^^ meta.diff.range.context meta.range.context.diff +\^^ punctuation.definition.range.begin.diff +\ ^ punctuation.separator +\ ^^^^ punctuation.definition.range.end.diff + The Nameless is the origin of Heaven and Earth; +! The named is the mother of all things. +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.changed.diff +\ <- punctuation.definition.changed.diff +! +\ <- markup.changed.diff punctuation.definition.changed.diff +\^ - meta.whitespace + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, +*************** +\^^^^^^^^^^^^^^ meta.separator.diff punctuation.separator.block.diff +*** 9,11 **** +\^^^^^^^^^^^^ meta.diff.range.context meta.range.context.diff +\ ^ punctuation.separator +\^^ punctuation.definition.range.begin.diff +\ ^^^^ punctuation.definition.range.end.diff +--- 8,13 ---- +\^^^^^^^^^^^^ meta.diff.range.context meta.range.context.diff +\ ^ punctuation.separator +\^^ punctuation.definition.range.begin.diff +\ ^^^^ punctuation.definition.range.end.diff + The two are the same, + But after they are produced, + they have different names. ++ They both may be called deep and profound. ++ Deeper and more profound, ++ The door of all subtleties! + + +Unified Format https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Unified +--- lao 2002-02-21 23:30:39.942229878 -0800 +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.header.from-file +\^^ punctuation.definition.from-file +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.number ++++ tzu 2002-02-21 23:30:50.442260588 -0800 +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.header.to-file +\^^ punctuation.definition.to-file +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.number +@@ -1,7 +1,6 @@ +\^^^^^^^^^^^^^^ meta.diff.range.unified meta.range.unified.diff +\^ punctuation.definition.range.begin.diff +\ ^^ punctuation.definition.range.end.diff +-The Way that can be told of is not the eternal Way; +-The name that can be named is not the eternal name. + The Nameless is the origin of Heaven and Earth; +-The Named is the mother of all things. ++The named is the mother of all things. ++ + Therefore let there always be non-being, + so we may see their subtlety, + And let there always be being, +@@ -9,3 +8,6 @@ + The two are the same, + But after they are produced, + they have different names. ++They both may be called deep and profound. ++Deeper and more profound, ++The door of all subtleties! + + +Diff3 Normal Format https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-diff3-Normal +====2 +\ <- meta.hunk.diff punctuation.section.hunk.diff +\^^^^^ meta.hunk.diff punctuation.section.hunk.diff +\ ^ constant.numeric.from-file.diff +1:1,2c +\ <- meta.hunk.diff meta.diff.range.normal meta.range.normal.diff meta.toc-list.hunk.diff constant.numeric.from-file.diff +\^^^^^ meta.hunk.diff meta.diff.range.normal meta.range.normal.diff meta.toc-list.hunk.diff +\^ punctuation.separator.file.diff +\ ^ punctuation.separator.range.diff +\ ^ support.function.diff +\ ^ - meta.toc-list +3:1,2c + The Way that can be told of is not the eternal Way; + The name that can be named is not the eternal name. +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.hunk.diff meta.block.diff markup.changed.diff +2:0a +\ <- meta.hunk.diff meta.diff.range.normal meta.range.normal.diff meta.toc-list.hunk.diff constant.numeric.from-file.diff +\^^^ meta.hunk.diff meta.diff.range.normal meta.range.normal.diff meta.toc-list.hunk.diff +\^ punctuation.separator.file.diff +\ ^ support.function.diff +\ ^ - meta.toc-list +====1 +\ <- meta.hunk.diff punctuation.section.hunk.diff +\^^^^^ meta.hunk.diff punctuation.section.hunk.diff +\ ^ constant.numeric.from-file.diff +1:4c + The Named is the mother of all things. +2:2,3c +3:4,5c + The named is the mother of all things. + +====3 +\ <- meta.hunk.diff punctuation.section.hunk.diff +\^^^^^ meta.hunk.diff punctuation.section.hunk.diff +\ ^ constant.numeric.from-file.diff +1:8c +\ <- meta.hunk.diff meta.diff.range.normal meta.range.normal.diff meta.toc-list.hunk.diff constant.numeric.from-file.diff +\^^^ meta.hunk.diff meta.diff.range.normal meta.range.normal.diff meta.toc-list.hunk.diff +\^ punctuation.separator.file.diff +\ ^ support.function.diff +\ ^ - meta.toc-list +2:7c + so we may see their outcome. +3:9c + so we may see their result. +==== +\ <- meta.hunk.diff punctuation.section.hunk.diff +\^^^^ meta.hunk.diff punctuation.section.hunk.diff +1:11a +2:11,13c + They both may be called deep and profound. + Deeper and more profound, + The door of all subtleties! +3:13,14c + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.hunk.diff meta.block.diff markup.changed.diff + + +Diff3 Edit Format https://www.gnu.org/software/diffutils/manual/diffutils.html#Selecting-Which-Changes-to-Incorporate +11a +\ <- meta.hunk.diff meta.diff.range.normal meta.range.normal.diff +\^^^ meta.hunk.diff +\^ meta.diff.range.normal meta.range.normal.diff +\ ^ support.function.diff + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.hunk.diff meta.block.diff markup.inserted.diff +. +\ <- meta.hunk.diff punctuation.terminator.hunk.diff +8c +\ <- meta.hunk.diff meta.diff.range.normal meta.range.normal.diff +\^^ meta.hunk.diff +\^ support.function.diff + so we may see their result. +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.hunk.diff meta.block.diff markup.changed.diff +. +\ <- meta.hunk.diff punctuation.terminator.hunk.diff +24d +\ <- meta.diff.range.normal meta.range.normal.diff +\^ meta.diff.range.normal meta.range.normal.diff +\ ^ support.function.diff + + This is removed content +\^^^^^^^^^^^^^^^^^^^^^^^^^ meta.hunk.diff meta.block.diff markup.deleted.diff +. +\ <- meta.hunk.diff punctuation.terminator.hunk.diff + + +SVN sample https://svnbook.red-bean.com/en/1.7/svn-book.html#idm10685 +Index: deleted-file +\^^^^^^^^^^^^^^^^^^ meta.mapping.diff meta.diff.index meta.index.diff +\^^^^ meta.mapping.key.diff keyword.other.diff +\ ^ punctuation.separator.key-value.diff +\ ^^^^^^^^^^^^ meta.mapping.value.diff meta.toc-list.file-name.diff +=================================================================== +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.diff punctuation.separator.block.diff +--- deleted-file (revision 3) +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.from-file meta.header.from-file.diff +\^^ punctuation.definition.from-file.diff +\ ^^^^^^^^^^^^ comment.block.diff ++++ deleted-file (working copy) +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.to-file meta.header.to-file.diff +\^^ punctuation.definition.to-file.diff +\ ^^^^^^^^^^^^^^ comment.block.diff +@@ -1 +0,0 @@ +\^^^^^^^^^^^^ meta.diff.range.unified meta.range.unified.diff meta.toc-list.hunk.diff +\^ punctuation.definition.range.begin.diff +\ ^ support.function.diff +\ ^ support.function.diff +\ ^ punctuation.separator.sequence.diff +\ ^^ punctuation.definition.range.end.diff +-This file will be deleted. +\^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.deleted.diff +Index: changed-file +\^^^^^^^^^^^^^^^^^^ meta.mapping.diff meta.diff.index meta.index.diff +\^^^^ meta.mapping.key.diff keyword.other.diff +\ ^ punctuation.separator.key-value.diff +\ ^^^^^^^^^^^^ meta.mapping.value.diff meta.toc-list.file-name.diff +=================================================================== +--- changed-file (revision 4) ++++ changed-file (working copy) +@@ -1,6 +1,6 @@ + The letters in a line of text + Could make your day much better. + But expanded into paragraphs, +-I'd tell of kangaroos and calves +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.deleted.diff ++I'd tell of monkeys and giraffes +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.inserted.diff + Until you were all smiles and laughs + From my letter made of letters. + +Property changes on: changed-file +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.diff meta.diff.index meta.index.diff +\^^^^^^^^^^^^^^^^^^ meta.mapping.key.diff keyword.other.diff +\ ^ punctuation.separator.key-value.diff +\ ^^^^^^^^^^^^ meta.mapping.value.diff meta.toc-list.file-name.diff +___________________________________________________________________ +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.diff punctuation.separator.block.diff +Added: propname +\^^^^^^^^^^^^^^ meta.mapping.diff meta.diff.index meta.index.diff +\^^^^ meta.mapping.key.diff keyword.other.diff +\ ^ punctuation.separator.key-value.diff +\ ^^^^^^^^ meta.mapping.value.diff meta.toc-list.file-name.diff +## -0,0 +1 ## ++propvalue +\^^^^^^^^^ markup.inserted.diff +Index: added-file +=================================================================== +--- added-file (revision 0) ++++ added-file (working copy) +@@ -0,0 +1 @@ ++This is an added file. + + +https://www.gnu.org/software/diffutils/manual/diffutils.html#Marking-Conflicts-1 +<<<<<<< A +\^^^^^^^^^ meta.block.conflict.diff - meta.block meta.block - markup +\^^^^^^ punctuation.section.block.begin.diff +\ ^ - entity - punctuation +\ ^ entity.name.section.diff +\ ^ - entity +lines from A +\^^^^^^^^^^^^ meta.block.conflict.diff markup.deleted.diff - meta.block meta.block +======= +\^^^^^^^ meta.block.conflict.diff - meta.block meta.block - markup +\^^^^^^ punctuation.section.block.diff +lines from B +\^^^^^^^^^^^ meta.block.conflict.diff markup.inserted.diff +>>>>>>> B +\^^^^^^^^^ meta.block.conflict.diff - meta.block meta.block - markup +\^^^^^^ punctuation.section.block.end.diff +\ ^ - entity +\ ^ entity.name.section.diff +\ ^ - entity +context context +\^^^^^^^^^^^^^^^ - meta.block + +<<<<<<< A +lines from A +||||||| B +\^^^^^^^^^ meta.block.conflict.diff - meta.block meta.block - markup +\^^^^^^ punctuation.section.block.diff +\ ^ - entity - punctuation +\ ^ entity.name.section.diff +\ ^ - entity +lines from B +\^^^^^^^^^^^^ meta.block.conflict.diff comment.block.diff - meta.block meta.block - markup +======= +\^^^^^^ meta.block.conflict.diff punctuation.section.block.diff - meta.block meta.block - markup +> +\ <- meta.block.conflict.diff markup.inserted.diff - punctuation - invalid +< +\ <- meta.block.conflict.diff markup.inserted.diff - punctuation - invalid +||||| +\^^^^ meta.block.conflict.diff markup.inserted.diff invalid.illegal.conflict.diff +lines from C +\^^^^^^^^^^^^ meta.block.conflict.diff markup.inserted.diff +>>>>>>> C +context context +\ <- - meta.block + +<<<<<<< tzu +======= +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +>>>>>>> tao + +<<<<<<< lao +||||||| tzu +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +>>>>>>> tao + +<<<<<<< lao +======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +>>>>>>> tao + + +https://www.gnu.org/software/diffutils/manual/diffutils.html#Generating-the-Merged-Output-Directly +<<<<<<< tzu +======= +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +>>>>>>> tao +The Nameless is the origin of Heaven and Earth; +The Named is the mother of all things. +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their result. +The two are the same, +But after they are produced, + they have different names. +<<<<<<< lao +||||||| tzu +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! +======= + + -- The Way of Lao-Tzu, tr. Wing-tsit Chan +>>>>>>> tao + +If you have questions, please +<<<<<<< HEAD +open an issue +======= +ask your question in IRC. +>>>>>>> branch-a + + +\ https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging +#! /usr/bin/env ruby + +def hello +<<<<<<< ours + puts 'hola world' +||||||| base + puts 'hello world' +======= + puts 'hello mundo' +>>>>>>> theirs +end + +hello() + + +\ https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#_basic_merge_conflicts +<<<<<<< HEAD:index.html +
+======= + +>>>>>>> iss53:index.html + + +\ https://git-scm.com/docs/rerere.html#_nested_conflicts +<<<<<<< HEAD +\^^^^^^^^^^^^ meta.block.conflict.diff +\^^^^^^ punctuation.section.block.begin.diff +\ ^^^^ entity.name.section.diff +111 +\^^ meta.block.conflict.diff markup.deleted.diff +======= +\^^^^^^^ meta.block.conflict.diff +\^^^^^^ punctuation.section.block.diff +<<<<<<< HEAD +\^^^^^^^^^^^^ meta.block.conflict.diff markup.inserted.diff meta.block.conflict.diff +\^^^^^^ punctuation.section.block.begin.diff +\ ^^^^ entity.name.section.diff +333 +\^^ meta.block.conflict.diff markup.inserted.diff meta.block.conflict.diff markup.deleted.diff +======= +\^^^^^^ meta.block.conflict.diff markup.inserted.diff meta.block.conflict punctuation.section.block.diff +222 +\^^ meta.block.conflict.diff markup.inserted.diff meta.block.conflict markup.inserted.diff +>>>>>>> branch-2 +\^^^^^^^^^^^^^^^ meta.block.conflict markup.inserted.diff meta.block.conflict.diff +\^^^^^^ punctuation.section.block.end.diff +\ ^^^^^^^^ entity.name.section.diff +>>>>>>> branch-3~ +\^^^^^^^^^^^^^^^^ meta.block.conflict.diff +\^^^^^^ punctuation.section.block.end.diff +\ ^^^^^^^^^ entity.name.section.diff + + +\ https://www.gnu.org/software/diffutils/manual/diffutils.html#Example-Side-by-Side +The Way that can be told of is n < +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.deleted.diff +\ ^ punctuation.definition.deleted.diff +The name that can be named is no < +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.deleted.diff +\ ^ punctuation.definition.deleted.diff +The Nameless is the origin of He The Nameless is the origin of He +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - markup +The Named is the mother of all t | The named is the mother of all t +\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.changed.diff +\ ^ punctuation.definition.changed.diff +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.changed.diff + > +\ ^ punctuation.definition.inserted.diff +Therefore let there always be no Therefore let there always be no + so we may see their subtlety, so we may see their subtlety, +And let there always be being, And let there always be being, + so we may see their outcome. so we may see their outcome. +The two are the same, The two are the same, +But after they are produced, But after they are produced, + they have different names. they have different names. + > They both may be called deep and +\ ^ punctuation.definition.inserted.diff +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.inserted.diff + > Deeper and more profound, +\ ^ punctuation.definition.inserted.diff +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.inserted.diff + > The door of all subtleties! +\ ^ punctuation.definition.inserted.diff +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.inserted.diff diff --git a/Diff/tests/syntax_test_switch_to_git.diff b/Diff/tests/syntax_test_switch_to_git.diff new file mode 100644 index 0000000000..34296d957d --- /dev/null +++ b/Diff/tests/syntax_test_switch_to_git.diff @@ -0,0 +1,15 @@ +\ SYNTAX TEST "Packages/Git Formats/Git Diff.sublime-syntax" +From 8f72bad1baf19a53459661343e21d6491c3908d3 Mon Sep 17 00:00:00 2001 +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.diff - source source +\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.other.hash.git +From: Tony Luck