├── Commands ├── Active File With Arbitrary File….tmCommand ├── Apply Patch from Clipboard.tmCommand ├── Apply Patch.tmCommand ├── Diff Buffer With Clipboard.plist ├── Diff Selected Files (Simple).plist ├── Diff Selected Files.plist ├── Diff With File on Disk.plist ├── Merge Selected Files.plist └── Statistics (Lines Added:Removed).plist ├── Macros ├── Find Next Conflict.tmMacro ├── Replace Conflict With Newer Text.tmMacro └── Replace Conflict With Older Text.tmMacro ├── Preferences ├── Folding Patterns.tmPreferences ├── Markup style: Changed.plist ├── Markup style: Deleted.plist ├── Markup style: Diff metadata.plist ├── Markup style: Header.plist ├── Markup style: Inserted.plist ├── Markup style: Range.plist └── Symbol List: Indent Ranges.plist ├── README.mdown ├── Support ├── Diff.pl ├── both-hide.css ├── both-show.css ├── diff-norm.css ├── diff-rev.css ├── diff.css ├── flip_files.js └── styleswitcher.js ├── Syntaxes └── Diff.plist └── info.plist /Commands/Active File With Arbitrary File….tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | file=$(osascript <<"APPLESCRIPT" 12 | tell app "TextMate" 13 | try 14 | set theFile to choose file 15 | set the result to POSIX path of theFile 16 | on error 17 | set the result to "" 18 | end try 19 | end tell 20 | APPLESCRIPT) 21 | 22 | if [[ "$file" == "" ]]; then exit_discard; fi 23 | 24 | if diff --strip-trailing-cr --label "$file" --label "${TM_DISPLAYNAME}" -u "$file" -; then 25 | exit_show_tool_tip "There are no differences." 26 | fi 27 | 28 | input 29 | document 30 | inputFormat 31 | text 32 | keyEquivalent 33 | ^@D 34 | name 35 | Document With Arbitrary File… 36 | outputCaret 37 | afterOutput 38 | outputFormat 39 | text 40 | outputLocation 41 | newWindow 42 | semanticClass 43 | diff.document 44 | uuid 45 | 4050A252-C604-4D0C-8545-E50B22E2715B 46 | version 47 | 2 48 | 49 | 50 | -------------------------------------------------------------------------------- /Commands/Apply Patch from Clipboard.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | export PATCH_GET=0 12 | 13 | if [[ -z $TM_FILEPATH ]] 14 | then exit_discard 15 | else pbpaste | patch "$TM_FILEPATH" -p0 16 | fi 17 | 18 | fallbackInput 19 | none 20 | input 21 | selection 22 | inputFormat 23 | text 24 | keyEquivalent 25 | ^@D 26 | name 27 | Apply Patch From Clipboard to Current Document 28 | outputCaret 29 | afterOutput 30 | outputFormat 31 | text 32 | outputLocation 33 | toolTip 34 | semanticClass 35 | diff.files 36 | uuid 37 | 46842464-574C-477F-9DFB-BB38EA3C85BE 38 | version 39 | 2 40 | 41 | 42 | -------------------------------------------------------------------------------- /Commands/Apply Patch.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # patch may be the most brainfucked standard Unix tool ever. Make sure it doesn't try to access the network (it tends to ignore the -g option, I find) -- if you have Perforce installed, this can be a huge performance hit -- and it touches the network even for files that aren't controlled by Perforce. All files on the system get the lovely 'is this file locked'? treatment. Software tools, huh? 12 | 13 | export PATCH_GET=0 14 | 15 | path=$(osascript<<END 16 | tell application "TextMate" 17 | set theFile to choose folder with prompt "Where should I look for files to be patched?" 18 | set the result to POSIX path of theFile 19 | end tell 20 | END) 21 | 22 | if [[ -z $path ]]; then 23 | exit_discard 24 | else 25 | patch -d "$path" -p0 26 | fi 27 | 28 | input 29 | document 30 | inputFormat 31 | text 32 | keyEquivalent 33 | ^@D 34 | name 35 | Apply Patch to Files… 36 | outputCaret 37 | afterOutput 38 | outputFormat 39 | text 40 | outputLocation 41 | toolTip 42 | semanticClass 43 | diff.files 44 | uuid 45 | 54D1CEF2-10AB-407B-AAB2-6AEA06B297B1 46 | version 47 | 2 48 | 49 | 50 | -------------------------------------------------------------------------------- /Commands/Diff Buffer With Clipboard.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | if diff --strip-trailing-cr --label "${TM_DISPLAYNAME}" --label "(clipboard)" -u - <(pbpaste); then 12 | echo "There are no differences." 13 | else 14 | exit_create_new_document 15 | fi 16 | 17 | input 18 | selection 19 | inputFormat 20 | text 21 | keyEquivalent 22 | ^@D 23 | name 24 | Document / Selection With Clipboard 25 | outputCaret 26 | afterOutput 27 | outputFormat 28 | text 29 | outputLocation 30 | toolTip 31 | semanticClass 32 | diff.document 33 | uuid 34 | 674E54F5-065E-4224-9626-673903B7C0E0 35 | version 36 | 2 37 | 38 | 39 | -------------------------------------------------------------------------------- /Commands/Diff Selected Files (Simple).plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | eval arr=("$TM_SELECTED_FILES") 12 | if [[ ${#arr[@]} != 2 ]]; then 13 | exit_show_tool_tip $'You need to select exactly two\nfiles in the project drawer.' 14 | fi 15 | 16 | if eval diff -u "$TM_SELECTED_FILES"; then 17 | exit_show_tool_tip "There are no differences." 18 | fi 19 | 20 | input 21 | none 22 | inputFormat 23 | text 24 | keyEquivalent 25 | ^@D 26 | name 27 | Selected Files in Project Drawer 28 | outputCaret 29 | afterOutput 30 | outputFormat 31 | text 32 | outputLocation 33 | newWindow 34 | semanticClass 35 | diff.files 36 | uuid 37 | D04AFBD3-8110-11D9-8E5B-0011242E4184 38 | version 39 | 2 40 | 41 | 42 | -------------------------------------------------------------------------------- /Commands/Diff Selected Files.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | eval arr=("$TM_SELECTED_FILES") 12 | if [[ ${#arr[@]} != 2 ]]; then 13 | echo -e "You need to select exactly two files in the project drawer." 14 | exit_show_tool_tip 15 | fi 16 | 17 | perl "$TM_BUNDLE_SUPPORT/Diff.pl" 18 | 19 | input 20 | none 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ^@D 25 | name 26 | Selected Files in Project Drawer (HTML) 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | html 31 | outputLocation 32 | newWindow 33 | semanticClass 34 | diff.files 35 | uuid 36 | 6A811265-81DC-11D9-9AA2-000D9332809C 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Commands/Diff With File on Disk.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | if [[ ! -e "$TM_FILEPATH" ]]; then 12 | exit_show_tool_tip "There is no file on disk" 13 | fi 14 | 15 | if diff --strip-trailing-cr --label "$TM_FILENAME (saved version)" --label "(current document)" -u "$TM_FILEPATH" -; then 16 | exit_show_tool_tip "There are no differences." 17 | fi 18 | 19 | input 20 | document 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ^@D 25 | name 26 | Document With Saved Copy 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | text 31 | outputLocation 32 | newWindow 33 | semanticClass 34 | diff.document 35 | uuid 36 | 0979659D-126E-467F-AC07-599979A42D67 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Commands/Merge Selected Files.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | eval arr=("$TM_SELECTED_FILES") 12 | if [[ ${#arr[@]} == 2 ]]; 13 | then ${TM_OPENDIFF:-opendiff} "${arr[0]}" "${arr[1]}" 14 | else echo -e "You need to select exactly two\nfiles in the project drawer." 15 | fi 16 | 17 | input 18 | none 19 | inputFormat 20 | text 21 | keyEquivalent 22 | ^@D 23 | name 24 | Merge Selected Files… 25 | outputCaret 26 | afterOutput 27 | outputFormat 28 | text 29 | outputLocation 30 | toolTip 31 | requiredCommands 32 | 33 | 34 | command 35 | opendiff 36 | locations 37 | 38 | /usr/bin/opendiff 39 | 40 | variable 41 | TM_OPENDIFF 42 | 43 | 44 | semanticClass 45 | diff.files 46 | uuid 47 | 239E196A-7106-4DC9-8FAE-0A9CA7540AFA 48 | version 49 | 2 50 | 51 | 52 | -------------------------------------------------------------------------------- /Commands/Statistics (Lines Added:Removed).plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | egrep -v '^(\+\+\+|---) '|\ 12 | tee >(add=$(grep ^+|wc -l); echo 1>&2 "Lines Added $add") \ 13 | |{ rem=$(grep ^-|wc -l); wait; echo "Lines Removed $rem"; } 14 | 15 | input 16 | document 17 | inputFormat 18 | text 19 | keyEquivalent 20 | ^N 21 | name 22 | Statistics (Lines Added/Removed) 23 | outputCaret 24 | afterOutput 25 | outputFormat 26 | text 27 | outputLocation 28 | toolTip 29 | scope 30 | source.diff 31 | semanticClass 32 | diff.document 33 | uuid 34 | B9091553-4317-415E-B381-4609BD453E01 35 | version 36 | 2 37 | 38 | 39 | -------------------------------------------------------------------------------- /Macros/Find Next Conflict.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | action 11 | findNext 12 | findString 13 | ^(?=<<<<<<<) 14 | regularExpression 15 | 16 | wrapAround 17 | 18 | 19 | command 20 | findWithOptions: 21 | 22 | 23 | keyEquivalent 24 | ^| 25 | name 26 | Find Next Conflict 27 | scope 28 | attr.scm.status.conflicted, 29 | scopeType 30 | local 31 | uuid 32 | 7494B11B-2A67-4BAD-B652-40205D354423 33 | 34 | 35 | -------------------------------------------------------------------------------- /Macros/Replace Conflict With Newer Text.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | action 11 | findNext 12 | findString 13 | (?m:<<<<<<<[^\n]*?\n(.*?\n?)=======\n(.*?\n?)>>>>>>>([^\n]*)\n) 14 | regularExpression 15 | 16 | wrapAround 17 | 18 | 19 | command 20 | findWithOptions: 21 | 22 | 23 | argument 24 | 25 | action 26 | replace 27 | findString 28 | (?m:<<<<<<<[^\n]*?\n(.*?\n?)=======\n(.*?\n?)>>>>>>>([^\n]*)\n) 29 | regularExpression 30 | 31 | replaceAllScope 32 | document 33 | replaceString 34 | $2 35 | wrapAround 36 | 37 | 38 | command 39 | findWithOptions: 40 | 41 | 42 | keyEquivalent 43 | ^} 44 | name 45 | Replace Conflict With Newer Text 46 | scope 47 | attr.scm.status.conflicted, 48 | scopeType 49 | local 50 | uuid 51 | 792B95BE-0CD5-4AC1-854A-901E7DD5AA30 52 | 53 | 54 | -------------------------------------------------------------------------------- /Macros/Replace Conflict With Older Text.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | action 11 | findNext 12 | findString 13 | (?m:<<<<<<<[^\n]*?\n(.*?\n?)=======\n(.*?\n?)>>>>>>>([^\n]*)\n) 14 | regularExpression 15 | 16 | wrapAround 17 | 18 | 19 | command 20 | findWithOptions: 21 | 22 | 23 | argument 24 | 25 | action 26 | replace 27 | findString 28 | (?m:<<<<<<<[^\n]*?\n(.*?\n?)=======\n(.*?\n?)>>>>>>>([^\n]*)\n) 29 | regularExpression 30 | 31 | replaceAllScope 32 | document 33 | replaceString 34 | $1 35 | wrapAround 36 | 37 | 38 | command 39 | findWithOptions: 40 | 41 | 42 | keyEquivalent 43 | ^{ 44 | name 45 | Replace Conflict With Older Text 46 | scope 47 | attr.scm.status.conflicted, 48 | scopeType 49 | local 50 | uuid 51 | 2A82E9A1-A70E-4268-86DF-A20C12D2FA01 52 | 53 | 54 | -------------------------------------------------------------------------------- /Preferences/Folding Patterns.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Folding Patterns 7 | scope 8 | source.diff 9 | settings 10 | 11 | foldingIndentedBlockIgnore 12 | ^[-+!<> ] 13 | foldingIndentedBlockStart 14 | ^(@@ |\d+[acd]\d+|diff ) 15 | 16 | uuid 17 | 9B46F71B-3813-4F2E-AD9C-D4C6FAAFC169 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Markup style: Changed.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Style: Changed 7 | scope 8 | markup.changed 9 | settings 10 | 11 | background 12 | #F5C411 13 | foreground 14 | #FFFFFF 15 | 16 | uuid 17 | EB0FD215-C2EE-4576-86FD-ABA3EDCB5A7B 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Markup style: Deleted.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Style: Deleted 7 | scope 8 | markup.deleted 9 | settings 10 | 11 | background 12 | #FF3D3D 13 | foreground 14 | #FFFFFF 15 | 16 | uuid 17 | FFF345C5-D3B4-4975-A610-69CC645FEE7C 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Markup style: Diff metadata.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Style: Index 7 | scope 8 | meta.diff.index 9 | settings 10 | 11 | background 12 | #3467D1 13 | fontStyle 14 | italic 15 | foreground 16 | #FFFFFF 17 | 18 | uuid 19 | F9C2B477-B6F7-4951-953B-32BFEF121F7C 20 | 21 | 22 | -------------------------------------------------------------------------------- /Preferences/Markup style: Header.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Style: Header 7 | scope 8 | meta.diff.header 9 | settings 10 | 11 | background 12 | #5685E3 13 | foreground 14 | #FFFFFF 15 | 16 | uuid 17 | ED5636AE-09EF-46C4-A4F8-B88F701763E2 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Markup style: Inserted.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Style: Inserted 7 | scope 8 | markup.inserted 9 | settings 10 | 11 | background 12 | #73FF65 13 | foreground 14 | #000000 15 | 16 | uuid 17 | 7D036841-43BD-49CA-892F-0A6837EF8FB7 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Markup style: Range.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Style: Range 7 | scope 8 | meta.diff.range 9 | settings 10 | 11 | background 12 | #3467D1 13 | fontStyle 14 | italic 15 | foreground 16 | #FFFFFF 17 | 18 | uuid 19 | 71A420A8-0892-4622-BDA4-CC00D98C59E6 20 | 21 | 22 | -------------------------------------------------------------------------------- /Preferences/Symbol List: Indent Ranges.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: Indent Ranges 7 | scope 8 | source.diff meta.diff.range 9 | settings 10 | 11 | comment 12 | Insert (figure space) padding 13 | so that “+nnn,n” becomes “+ nnn, n” 14 | symbolTransformation 15 | 16 | s/[-+](\d)(\d)?(\d)?(\d)?,/(?4:: (?3:: (?2:: )))$0/g; 17 | s/,(\d)\b/, $1/g; 18 | s/^/ /; 19 | 20 | 21 | uuid 22 | A0B3B6D2-59B1-407F-B310-7FA67222B37A 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. 4 | 5 | # General 6 | 7 | * [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_ 8 | * [Commit Styleguide](http://kb.textmate.org/commit_styleguide) — _before you send a pull request_ 9 | * [Writing Bug Reports](http://kb.textmate.org/writing_bug_reports) — _before you report an issue_ 10 | 11 | # License 12 | 13 | If not otherwise specified (see below), files in this repository fall under the following license: 14 | 15 | Permission to copy, use, modify, sell and distribute this 16 | software is granted. This software is provided "as is" without 17 | express or implied warranty, and with no claim as to its 18 | suitability for any purpose. 19 | 20 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”. -------------------------------------------------------------------------------- /Support/Diff.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # (c) 2005, Eric Hsu 4 | 5 | # To Do 6 | # what's with the 'no ending Newline'? 7 | # Allow merging? 8 | # Allow swapping of old and new 9 | # Allow last diff (if no SELECTED_FILES) 10 | # Allow hiding of common (use CSS) 11 | 12 | # Stylesheet switching from http://old.alistapart.com/stories/alternate/ 13 | 14 | my $css = $ENV{'TM_BUNDLE_SUPPORT'}; 15 | 16 | my $html = < 18 | 19 | 20 | END 21 | 22 | # $html .= < 24 | # 25 | # 26 | # 27 | # 28 | # END 29 | 30 | $html .= ''; 31 | 32 | my $files = $ENV{'TM_SELECTED_FILES'}; 33 | $diffout = `diff -s -U99999 $files 2> /dev/null`; 34 | 35 | $diffout =~ s/\n\\ No newline at end of file\n/\n/g; 36 | 37 | ( $OLD1, $OLD2, $NEW1, $NEW2 ) = 38 | ( $files =~ /\'(.*?)([^\\])\'\s+\'(.*?)([^\\])\'/ ); 39 | $OLD = $OLD1 . $OLD2; 40 | $NEW = $NEW1 . $NEW2; 41 | 42 | $diffout =~ s/\n\@.*?\n/\n\n/; 43 | 44 | # use HTML::Entities; 45 | # encode_entities($diffout); 46 | $diffout =~ s/&/&/g; # silly; make sure this comes before the next two. 47 | $diffout =~ s//>/g; 49 | 50 | $oldline = $newline = -2; 51 | 52 | foreach ( split( /\n/, $diffout ) ) { 53 | $TMURL = "" ; 57 | } 58 | 59 | if (/^\-/) { 60 | s/^\-(.*)$/$1<\/span>/g; 61 | $oldline++; 62 | $TMURL .= $OLD; 63 | $TMURL .= "&line=" . $oldline if ( $oldline > 0 ); 64 | } 65 | elsif (/^\+/) { 66 | s/^\+(.*)$/$1<\/span>/g; 67 | $newline++; 68 | $TMURL .= $NEW; 69 | $TMURL .= "&line=" . $newline if ( $newline > 0 ); 70 | 71 | } 72 | else { # this is common text. By default, we jump to the new version. 73 | s/^(.*?)$/$1<\/span>/g; 74 | $newline++; 75 | $oldline++; 76 | 77 | $TMURL .= $NEW; 78 | $TMURL .= "&line=" . $newline if ( $newline > 0 ); 79 | } 80 | 81 | $html .= $TMURL . '">' . $_ . "" . "
"; 82 | } 83 | 84 | $html .= "
\n"; 85 | 86 | print $html; 87 | 88 | sub unquote { 89 | my $in = shift; 90 | $in =~ s/^'//; 91 | s/'$//; 92 | return $in; 93 | } 94 | 95 | sub optionlinks { 96 | # return <Hide 98 | # Show 99 | # END 100 | } 101 | -------------------------------------------------------------------------------- /Support/both-hide.css: -------------------------------------------------------------------------------- 1 | .both{visibility:hidden; color:black} -------------------------------------------------------------------------------- /Support/both-show.css: -------------------------------------------------------------------------------- 1 | .both{visibility:visible; color:black} -------------------------------------------------------------------------------- /Support/diff-norm.css: -------------------------------------------------------------------------------- 1 | .old{font-weight: bold;color:red} 2 | .new{font-weight: bold;color:blue} 3 | -------------------------------------------------------------------------------- /Support/diff-rev.css: -------------------------------------------------------------------------------- 1 | .old{font-weight: bold;color:blue} 2 | .new{font-weight: bold;color:red} 3 | -------------------------------------------------------------------------------- /Support/diff.css: -------------------------------------------------------------------------------- 1 | body{font-family: "Bitstream Vera Sans Mono", monospace;} 2 | a, a:visited, a:link {text-decoration: none;color:inherit;font-family: inherit;} 3 | a:hover,a:active {background-color: #a3c8ff; color:inherit;font-family: inherit;text-decoration: none;} 4 | .old{font-weight: bold;color:red;} 5 | .new{font-weight: bold;color:green;} 6 | .both{color:black;font-family: inherit;} -------------------------------------------------------------------------------- /Support/flip_files.js: -------------------------------------------------------------------------------- 1 | /* a _very_ basic implementation of flipping 2 | the visibility of the changed files list. 3 | 4 | copyright 2005 torsten becker 5 | no warranty, that it doesn't crash your system. 6 | you are of course free to modify this. 7 | */ 8 | 9 | 10 | /* show: files + hide-button, hide: show-button.. */ 11 | function show_files( base_id ) 12 | { 13 | document.getElementById( base_id ).style.display = 'block'; 14 | document.getElementById( base_id+'_show' ).style.display = 'none'; 15 | document.getElementById( base_id+'_hide' ).style.display = 'inline'; 16 | } 17 | 18 | /* hide: files + hide-button, show: show-button.. */ 19 | function hide_files( base_id ) 20 | { 21 | document.getElementById( base_id ).style.display = 'none'; 22 | document.getElementById( base_id+'_show' ).style.display = 'inline'; 23 | document.getElementById( base_id+'_hide' ).style.display = 'none'; 24 | } 25 | -------------------------------------------------------------------------------- /Support/styleswitcher.js: -------------------------------------------------------------------------------- 1 | function setActiveStyleSheet(title) { var i, a, main; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; } } } function getActiveStyleSheet() { var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title"); } return null; } function getPreferredStyleSheet() { var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title") ) return a.getAttribute("title"); } return null; } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } window.onload = function(e) { var cookie = readCookie("style"); var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title); } window.onunload = function(e) { var title = getActiveStyleSheet(); createCookie("style", title, 365); } var cookie = readCookie("style"); var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title); -------------------------------------------------------------------------------- /Syntaxes/Diff.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | patch 8 | diff 9 | rej 10 | 11 | firstLineMatch 12 | (?x)^ 13 | (===\ modified\ file 14 | |==== \s* // .+ \s - \s .+ \s+ ==== 15 | |Index:\ 16 | |---\ [^%\n] 17 | |\*\*\*.*\d{4}\s*$ 18 | |\d+(,\d+)* (a|d|c) \d+(,\d+)* $ 19 | |diff\ --git\ 20 | |commit\ [0-9a-f]{40}$ 21 | ) 22 | keyEquivalent 23 | ^~D 24 | name 25 | Diff 26 | patterns 27 | 28 | 29 | captures 30 | 31 | 1 32 | 33 | name 34 | punctuation.definition.separator.diff 35 | 36 | 37 | match 38 | ^((\*{15})|(={67})|(-{3}))$\n? 39 | name 40 | meta.separator.diff 41 | 42 | 43 | match 44 | ^\d+(,\d+)*(a|d|c)\d+(,\d+)*$\n? 45 | name 46 | meta.diff.range.normal 47 | 48 | 49 | captures 50 | 51 | 1 52 | 53 | name 54 | punctuation.definition.range.diff 55 | 56 | 2 57 | 58 | name 59 | meta.toc-list.line-number.diff 60 | 61 | 3 62 | 63 | name 64 | punctuation.definition.range.diff 65 | 66 | 67 | match 68 | ^(@@)\s*(.+?)\s*(@@)($\n?)? 69 | name 70 | meta.diff.range.unified 71 | 72 | 73 | captures 74 | 75 | 3 76 | 77 | name 78 | punctuation.definition.range.diff 79 | 80 | 4 81 | 82 | name 83 | punctuation.definition.range.diff 84 | 85 | 6 86 | 87 | name 88 | punctuation.definition.range.diff 89 | 90 | 7 91 | 92 | name 93 | punctuation.definition.range.diff 94 | 95 | 96 | match 97 | ^(((\-{3}) .+ (\-{4}))|((\*{3}) .+ (\*{4})))$\n? 98 | name 99 | meta.diff.range.context 100 | 101 | 102 | match 103 | ^diff --git a/.*$\n? 104 | name 105 | meta.diff.header.git 106 | 107 | 108 | match 109 | ^diff (-|\S+\s+\S+).*$\n? 110 | name 111 | meta.diff.header.command 112 | 113 | 114 | captures 115 | 116 | 4 117 | 118 | name 119 | punctuation.definition.from-file.diff 120 | 121 | 6 122 | 123 | name 124 | punctuation.definition.from-file.diff 125 | 126 | 7 127 | 128 | name 129 | punctuation.definition.from-file.diff 130 | 131 | 132 | match 133 | (^(((-{3}) .+)|((\*{3}) .+))$\n?|^(={4}) .+(?= - )) 134 | name 135 | meta.diff.header.from-file 136 | 137 | 138 | captures 139 | 140 | 2 141 | 142 | name 143 | punctuation.definition.to-file.diff 144 | 145 | 3 146 | 147 | name 148 | punctuation.definition.to-file.diff 149 | 150 | 4 151 | 152 | name 153 | punctuation.definition.to-file.diff 154 | 155 | 156 | match 157 | (^(\+{3}) .+$\n?| (-) .* (={4})$\n?) 158 | name 159 | meta.diff.header.to-file 160 | 161 | 162 | captures 163 | 164 | 3 165 | 166 | name 167 | punctuation.definition.inserted.diff 168 | 169 | 6 170 | 171 | name 172 | punctuation.definition.inserted.diff 173 | 174 | 175 | match 176 | ^(((>)( .*)?)|((\+).*))$\n? 177 | name 178 | markup.inserted.diff 179 | 180 | 181 | captures 182 | 183 | 1 184 | 185 | name 186 | punctuation.definition.changed.diff 187 | 188 | 189 | match 190 | ^(!).*$\n? 191 | name 192 | markup.changed.diff 193 | 194 | 195 | captures 196 | 197 | 3 198 | 199 | name 200 | punctuation.definition.deleted.diff 201 | 202 | 6 203 | 204 | name 205 | punctuation.definition.deleted.diff 206 | 207 | 208 | match 209 | ^(((<)( .*)?)|((-).*))$\n? 210 | name 211 | markup.deleted.diff 212 | 213 | 214 | begin 215 | ^(#) 216 | captures 217 | 218 | 1 219 | 220 | name 221 | punctuation.definition.comment.diff 222 | 223 | 224 | comment 225 | Git produces unified diffs with embedded comments" 226 | end 227 | \n 228 | name 229 | comment.line.number-sign.diff 230 | 231 | 232 | match 233 | ^index [0-9a-f]{7,40}\.\.[0-9a-f]{7,40}.*$\n? 234 | name 235 | meta.diff.index.git 236 | 237 | 238 | captures 239 | 240 | 1 241 | 242 | name 243 | punctuation.separator.key-value.diff 244 | 245 | 2 246 | 247 | name 248 | meta.toc-list.file-name.diff 249 | 250 | 251 | match 252 | ^Index(:) (.+)$\n? 253 | name 254 | meta.diff.index 255 | 256 | 257 | match 258 | ^Only in .*: .*$\n? 259 | name 260 | meta.diff.only-in 261 | 262 | 263 | scopeName 264 | source.diff 265 | uuid 266 | 7E848FF4-708E-11D9-97B4-0011242E4184 267 | 268 | 269 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | gz-ohaqyrf@znpebzngrf.pbz 7 | contactName 8 | Allan Odgaard 9 | description 10 | Syntax highlight and <a href="http://en.wikipedia.org/wiki/Diff">diff</a> related functionality, for example see differences between document and last saved version, use a diff file as a patch, etc. 11 | mainMenu 12 | 13 | items 14 | 15 | 674E54F5-065E-4224-9626-673903B7C0E0 16 | 0979659D-126E-467F-AC07-599979A42D67 17 | 4050A252-C604-4D0C-8545-E50B22E2715B 18 | ------------------------------------ 19 | D04AFBD3-8110-11D9-8E5B-0011242E4184 20 | 6A811265-81DC-11D9-9AA2-000D9332809C 21 | ------------------------------------ 22 | 239E196A-7106-4DC9-8FAE-0A9CA7540AFA 23 | ------------------------------------ 24 | B9091553-4317-415E-B381-4609BD453E01 25 | ------------------------------------ 26 | 54D1CEF2-10AB-407B-AAB2-6AEA06B297B1 27 | 46842464-574C-477F-9DFB-BB38EA3C85BE 28 | ------------------------------------ 29 | 5AC09B51-F282-4A3B-891F-2B818FECC96D 30 | 31 | submenus 32 | 33 | 5AC09B51-F282-4A3B-891F-2B818FECC96D 34 | 35 | items 36 | 37 | 7494B11B-2A67-4BAD-B652-40205D354423 38 | ------------------------------------ 39 | 2A82E9A1-A70E-4268-86DF-A20C12D2FA01 40 | 792B95BE-0CD5-4AC1-854A-901E7DD5AA30 41 | 42 | name 43 | Merge Conflicts 44 | 45 | 46 | 47 | name 48 | Diff 49 | uuid 50 | C2D2BFF9-708D-11D9-BD09-0011242E4184 51 | 52 | 53 | --------------------------------------------------------------------------------