| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY file "(====|\*\*\*|\-\-\-|diff|Only in [^:]*:).*$"> |
| 5 |
]> |
| 6 |
<!-- |
| 7 |
2006-08-02: 1.10 Matthew Woehlke <[email protected]> |
| 8 |
Added folding. Context diff changes are now identified as old/new (using |
| 9 |
seperate attributes). Recognize 'Only in' from 'diff -r' output. |
| 10 |
There is currently a bug (KATE limitation?) where regions may sometimes |
| 11 |
pick up one line too many. |
| 12 |
2008-02-13: 1.11 Eduardo Robles Elvira <edulix AT gmail DOT com> |
| 13 |
Fixed folding. |
| 14 |
--> |
| 15 |
<language name="Diff" version="9" kateversion="5.62" section="Other" extensions="*.diff;*patch;*.rej" mimetype="text/x-patch"> |
| 16 |
|
| 17 |
<highlighting> |
| 18 |
|
| 19 |
<contexts> |
| 20 |
|
| 21 |
<context attribute="Normal Text" lineEndContext="#stay" name="Normal" fallthroughContext="AttrNormal"> |
| 22 |
<Detect2Chars attribute="Header" context="AttrHeader_Chunk" char="@" char1="@" beginRegion="chunk" column="0"/> |
| 23 |
<AnyChar attribute="Header" context="AttrHeader_Chunk" String="0123456789" beginRegion="chunk" column="0"/> |
| 24 |
<RegExpr attribute="Header" context="RChunk" String="^\*+$" beginRegion="chunk" column="0"/> |
| 25 |
<RegExpr attribute="File" context="#stay" String="^Only in [^:]*:.*$" column="0"/> |
| 26 |
<StringDetect attribute="File" context="AttrFile_RFile" String="diff" beginRegion="chunk" column="0"/> |
| 27 |
<StringDetect attribute="File" context="AttrFile" String="====" column="0"/> |
| 28 |
<StringDetect attribute="File" context="AttrFile_File" String="***" beginRegion="chunk" column="0"/> |
| 29 |
<StringDetect attribute="File" context="AttrFile_File" String="---" beginRegion="chunk" column="0"/> |
| 30 |
<IncludeRules context="FindDiff"/> |
| 31 |
<DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/> |
| 32 |
</context> |
| 33 |
|
| 34 |
<context attribute="Normal Text" lineEndContext="#stay" name="FindDiff"> |
| 35 |
<StringDetect attribute="File" context="AttrFile" String="---" column="0"/> |
| 36 |
<StringDetect attribute="Header" context="AttrHeader" String="+++" column="0"/> |
| 37 |
<AnyChar attribute="Added line" context="Added" String="+>" column="0"/> |
| 38 |
<AnyChar attribute="Removed line" context="Removed" String="-<" column="0"/> |
| 39 |
</context> |
| 40 |
|
| 41 |
<!-- block contexts --> |
| 42 |
<context attribute="Normal Text" lineEndContext="#stay" name="File" fallthroughContext="AttrNormal"> |
| 43 |
<IncludeRules context="FindDiff"/> |
| 44 |
<Detect2Chars attribute="Header" context="AttrHeader_ChunkInFile" char="@" char1="@" beginRegion="chunk" column="0"/> |
| 45 |
<AnyChar attribute="Header" context="AttrHeader_ChunkInFile" String="0123456789" beginRegion="chunk" column="0"/> |
| 46 |
<RegExpr attribute="Header" context="RChunkInFile" String="^\*+$" beginRegion="chunk" column="0"/> |
| 47 |
<RegExpr attribute="File" context="#pop" String="^&file;" endRegion="chunk" column="0"/> |
| 48 |
<DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/> |
| 49 |
</context> |
| 50 |
|
| 51 |
<context attribute="Normal Text" lineEndContext="#stay" name="Chunk" fallthroughContext="AttrNormal"> |
| 52 |
<IncludeRules context="FindDiff"/> |
| 53 |
<Detect2Chars attribute="Header" context="#pop" char="@" char1="@" endRegion="chunk" lookAhead="true" column="0"/> |
| 54 |
<AnyChar attribute="Header" context="#pop" String="0123456789" endRegion="chunk" lookAhead="true" column="0"/> |
| 55 |
<DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/> |
| 56 |
</context> |
| 57 |
|
| 58 |
<context attribute="Normal Text" lineEndContext="#stay" name="ChunkInFile" fallthroughContext="AttrNormal"> |
| 59 |
<IncludeRules context="FindDiff"/> |
| 60 |
<Detect2Chars attribute="Header" context="#pop" char="@" char1="@" endRegion="chunk" lookAhead="true" column="0"/> |
| 61 |
<AnyChar attribute="Header" context="#pop" String="0123456789" endRegion="chunk" lookAhead="true" column="0"/> |
| 62 |
<StringDetect attribute="Normal Text" context="#pop!AttrNormal" String="Index:" endRegion="chunk" column="0"/> |
| 63 |
<RegExpr attribute="File" context="#pop" String="^&file;" endRegion="chunk" lookAhead="true" column="0"/> |
| 64 |
<DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/> |
| 65 |
</context> |
| 66 |
|
| 67 |
<!-- block contexts (diff -r) --> |
| 68 |
<context attribute="Normal Text" lineEndContext="#stay" name="RFile" fallthroughContext="AttrNormal"> |
| 69 |
<RegExpr attribute="File" context="#pop" String="^(diff|Only in [^:]*:)" endRegion="chunk" lookAhead="true" column="0"/> |
| 70 |
<RegExpr attribute="Header" context="#stay" String="^&file;" column="0"/> |
| 71 |
<RegExpr attribute="Header" context="RChunkInFile" String="^\*+$" beginRegion="chunk" column="0"/> |
| 72 |
<IncludeRules context="File"/> |
| 73 |
</context> |
| 74 |
|
| 75 |
<context attribute="Normal Text" lineEndContext="#stay" name="RChunk" fallthroughContext="AttrNormal"> |
| 76 |
<RegExpr attribute="Header" context="#stay" String="^\*\*\* .* \*\*\*\*$" column="0"/> |
| 77 |
<RegExpr attribute="Header" context="RChunkNew" String="^\-\-\- .* \-\-\-\-$" column="0"/> |
| 78 |
<IncludeRules context="Chunk"/> |
| 79 |
</context> |
| 80 |
|
| 81 |
<context attribute="Normal Text" lineEndContext="#stay" name="RChunkInFile" fallthroughContext="AttrNormal"> |
| 82 |
<RegExpr attribute="Header" context="#stay" String="^\*\*\* .* \*\*\*\*$" column="0"/> |
| 83 |
<RegExpr attribute="Header" context="RChunkInFileNew" String="^\-\-\- .* \-\-\-\-$" column="0"/> |
| 84 |
<IncludeRules context="ChunkInFile"/> |
| 85 |
</context> |
| 86 |
|
| 87 |
<context attribute="Normal Text" lineEndContext="#stay" name="RChunkNew" fallthroughContext="AttrNormal"> |
| 88 |
<Detect2Chars attribute="Header" context="#pop#pop" char="@" char1="@" lookAhead="true" column="0"/> |
| 89 |
<AnyChar attribute="Header" context="#pop#pop" String="0123456789" lookAhead="true" column="0"/> |
| 90 |
<DetectChar attribute="Changed line (new)" context="ChangedNew" char="!" column="0"/> |
| 91 |
<IncludeRules context="FindDiff"/> |
| 92 |
</context> |
| 93 |
|
| 94 |
<context attribute="Normal Text" lineEndContext="#stay" name="RChunkInFileNew" fallthroughContext="AttrNormal"> |
| 95 |
<Detect2Chars attribute="Header" context="#pop#pop" char="@" char1="@" lookAhead="true" column="0"/> |
| 96 |
<AnyChar attribute="Header" context="#pop#pop" String="0123456789" lookAhead="true" column="0"/> |
| 97 |
<RegExpr attribute="File" context="#pop#pop" String="^&file;" endRegion="chunk" lookAhead="true" column="0"/> |
| 98 |
<DetectChar attribute="Changed line (new)" context="ChangedNew" char="!" column="0"/> |
| 99 |
<IncludeRules context="FindDiff"/> |
| 100 |
</context> |
| 101 |
|
| 102 |
<!-- line contexts --> |
| 103 |
<context attribute="Removed line" lineEndContext="#pop" name="Removed"/> |
| 104 |
<context attribute="Added line" lineEndContext="#pop" name="Added"/> |
| 105 |
<context attribute="Changed line (old)" lineEndContext="#pop" name="ChangedOld"/> |
| 106 |
<context attribute="Changed line (new)" lineEndContext="#pop" name="ChangedNew"/> |
| 107 |
|
| 108 |
<context attribute="Normal Text" lineEndContext="#pop" name="AttrNormal"/> |
| 109 |
<context attribute="File" lineEndContext="#pop" name="AttrFile"/> |
| 110 |
<context attribute="File" lineEndContext="#pop!File" name="AttrFile_File"/> |
| 111 |
<context attribute="File" lineEndContext="#pop!RFile" name="AttrFile_RFile"/> |
| 112 |
<context attribute="Header" lineEndContext="#pop" name="AttrHeader"/> |
| 113 |
<context attribute="Header" lineEndContext="#pop!Chunk" name="AttrHeader_Chunk"/> |
| 114 |
<context attribute="Header" lineEndContext="#pop!ChunkInFile" name="AttrHeader_ChunkInFile"/> |
| 115 |
</contexts> |
| 116 |
|
| 117 |
<itemDatas> |
| 118 |
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> |
| 119 |
<itemData name="File" defStyleNum="dsKeyword" spellChecking="false"/> |
| 120 |
<itemData name="Header" defStyleNum="dsDataType" spellChecking="false"/> |
| 121 |
<itemData name="Removed line" defStyleNum="dsString" spellChecking="false"/> |
| 122 |
<itemData name="Added line" defStyleNum="dsVariable" spellChecking="false"/> |
| 123 |
<itemData name="Changed line (old)" defStyleNum="dsString" spellChecking="false"/> |
| 124 |
<itemData name="Changed line (new)" defStyleNum="dsVariable" spellChecking="false"/> |
| 125 |
</itemDatas> |
| 126 |
|
| 127 |
</highlighting> |
| 128 |
|
| 129 |
</language> |