From 14ba5376aa589d7b3453033f2bfe22812dc1f080 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Thu, 29 Apr 2010 10:41:37 -0400 Subject: [PATCH] Added Ignore Whitespace variants of Clipboard and Arbitrary File diff commands --- ...th Clipboard (Ignore Whitespace).tmCommand | 26 ++++++++++++++ ...(Ignore Whitespace)\342\200\246.tmCommand" | 36 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Commands/Document : Selection With Clipboard (Ignore Whitespace).tmCommand create mode 100644 "Commands/Document With Arbitrary File (Ignore Whitespace)\342\200\246.tmCommand" diff --git a/Commands/Document : Selection With Clipboard (Ignore Whitespace).tmCommand b/Commands/Document : Selection With Clipboard (Ignore Whitespace).tmCommand new file mode 100644 index 0000000..e19f350 --- /dev/null +++ b/Commands/Document : Selection With Clipboard (Ignore Whitespace).tmCommand @@ -0,0 +1,26 @@ + + + + + beforeRunningCommand + nop + command + # set defaultCStringEncoding to UTF-8 +if diff --ignore-all-space --ignore-blank-lines --strip-trailing-cr --label "${TM_FILENAME:-untitled}" --label "(clipboard)" -u - <(__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste); then + echo "There are no differences." +else + exit_create_new_document +fi + + input + selection + keyEquivalent + ^@D + name + Document / Selection With Clipboard (Ignore Whitespace) + output + showAsTooltip + uuid + FC3024FC-B9AF-4893-8391-657038101038 + + diff --git "a/Commands/Document With Arbitrary File (Ignore Whitespace)\342\200\246.tmCommand" "b/Commands/Document With Arbitrary File (Ignore Whitespace)\342\200\246.tmCommand" new file mode 100644 index 0000000..e2582fd --- /dev/null +++ "b/Commands/Document With Arbitrary File (Ignore Whitespace)\342\200\246.tmCommand" @@ -0,0 +1,36 @@ + + + + + beforeRunningCommand + nop + command + file=$(osascript <<"APPLESCRIPT" +tell app "TextMate" + try + set theFile to choose file + set the result to POSIX path of theFile + on error + set the result to "" + end try +end tell +APPLESCRIPT) + +if [[ "$file" == "" ]]; then exit_discard; fi + +if diff --strip-trailing-cr --ignore-all-space --ignore-blank-lines --label "$file" --label "${TM_FILENAME:-untitled}" -u "$file" -; then + exit_show_tool_tip "There are no differences." +fi + + input + document + keyEquivalent + ^@D + name + Document With Arbitrary File (Ignore Whitespace)… + output + openAsNewDocument + uuid + 097468E8-90CC-4DC1-8548-76E3FBD94D73 + +