[TxMt] GTD2 cleanup patch

Mike Mellor alaskamike at gmail.com
Fri Oct 27 21:50:27 UTC 2006


Bill -

I never thought about empty lines in a file - I usually just have a laundry
list, or break stuff out into smaller project files.  My code intentionally
removes whitespace, to prevent the occasional empty line at te bottom of the
listfrom growing.  Maybe we need to look at creating some kind of plist to
cover this?

Mike

On 10/27/06, Bill Bumgarner <bbum at mac.com> wrote:
>
> It was bothering me that the cleanup command in GTD2 wasn't
> preserving whitespace before projects.  I.e. this...
>
>
> * Foo
> - bar
>
> * Baz
> - bob
>
> - fred
>
> Would be turned into:
>
> * Foo
> - bar
> * Baz
> - bob
> - fred
>
> This "fixes" it in a way that'll likely be laughed at.  Point and
> laugh away, it works for me... :-)
>
> b.bum
>
> Index: GTD2.tmbundle/Commands/Cleanup.tmCommand
> ===================================================================
> --- GTD2.tmbundle/Commands/Cleanup.tmCommand    (revision 5658)
> +++ GTD2.tmbundle/Commands/Cleanup.tmCommand    (working copy)
> @@ -17,7 +17,11 @@
>     if (myTest.pre_match != "+" and myTest.pre_match.length > 0)
>       puts line
>     else
> -    myDone = myDone + line
> +    if (line != "\n")
> +           myDone = myDone + line
> +       else
> +        puts "\n"
> +       end
>     end
> end
> puts myDone</string>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20061027/f05d6977/attachment.html>


More information about the textmate mailing list