Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added 'Apply Patch from Clipboard' command to Diff bundle. (Apologies…

… if I missed a conversation about this... it just seems really useful to me.)

git-svn-id: http://svn.textmate.org/trunk/Bundles/Diff.tmbundle@6863 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
commit 899dee3d20ebbcd018a5a03c89a4f28fc698a000 1 parent 4cee102
@canadaduane canadaduane authored
Showing with 37 additions and 0 deletions.
  1. +36 −0 Commands/Apply Patch from Clipboard.tmCommand
  2. +1 −0  info.plist
View
36 Commands/Apply Patch from Clipboard.tmCommand
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>export PATCH_GET=0
+export __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100
+
+if [[ -z $TM_FILEPATH ]]; then
+ exit_discard
+else
+ pbpaste | patch "$TM_FILEPATH" -p0
+fi
+
+# Reload patched file
+osascript&lt;&lt;END
+ tell app "Finder" to activate
+ tell app "TextMate" to activate
+END
+</string>
+ <key>fallbackInput</key>
+ <string>none</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^@D</string>
+ <key>name</key>
+ <string>Apply Patch from Clibpoard to Current Document</string>
+ <key>output</key>
+ <string>showAsTooltip</string>
+ <key>uuid</key>
+ <string>46842464-574C-477F-9DFB-BB38EA3C85BE</string>
+</dict>
+</plist>
View
1  info.plist
@@ -44,6 +44,7 @@
<string>239E196A-7106-4DC9-8FAE-0A9CA7540AFA</string>
<string>B9091553-4317-415E-B381-4609BD453E01</string>
<string>54D1CEF2-10AB-407B-AAB2-6AEA06B297B1</string>
+ <string>46842464-574C-477F-9DFB-BB38EA3C85BE</string>
<string>7E848FF4-708E-11D9-97B4-0011242E4184</string>
<string>7D036841-43BD-49CA-892F-0A6837EF8FB7</string>
<string>FFF345C5-D3B4-4975-A610-69CC645FEE7C</string>
Please sign in to comment.
Something went wrong with that request. Please try again.