I use the Diff bundle a lot. I regularly do a 'svn diff | mate' command prior to check-ins. One of the things I typically do with larger sets of files is collapse all the diffs so there is one file per line. I can then examine each group of changes, and once happy with the review (or as they get committed), I will delete the collapsed "line".
This is a tedious process because the foldings for a diff are not automatically done for me. This is one of many cases I've found where the folding separators cannot be described properly since the close of the fold is not a match for anything in particular, just the fact that a new fold is starting. (Another such case is for Markdown-- I'd like to provide foldings for the "# ..." header, down to the next available "# ..." header, but I can't express that.)
So what I do is start at the top of the file, then hit Option+Shift +⇣ which will select just that one file's diff somehow (I haven't investigated how TextMate knows to skip down to the next "Index..." line like that. Does it do so based on the lines identified as separators?). Then I hit ⌘+F1 to fold the selection.
Again this is very tedious, especially for a large diff. I would be very happy if someone found a way to automate this process. Ideally, it should be possible to describe a folding marker whose end is identified by the start of a new fold, but I don't think it's possible today.
-Brad
On May 20, 2007, at 1:29 AM, Brad Choate wrote:
Again this is very tedious, especially for a large diff. I would be very happy if someone found a way to automate this process. Ideally, it should be possible to describe a folding marker whose end is identified by the start of a new fold, but I don't think it's possible today.
Your right it is impossible with the current folding system. We'll have to wait and see if 2.0 changes that. :)
For now this macro should do it:
It beeps some at the end because I had to make it folded a lot of documents, but that appears to be the only downside.
Thanks, Michael. I was thinking about writing such a macro, but i wasn't satisfied that I couldn't make it process the whole document. This one stops after the first 18 foldings (running it again doesn't work since it starts with a select all command). But I changed it to remove the select all command and so forth so that it is repeatable now. The modified version is attached.
(It would also be nice if you could instruct TM to continue running a macro as long as a search command or other action (such as moving down when you're already at the end of the document) didn't fail.)
Thanks again! -Brad
On May 20, 2007, at 12:35 AM, Michael Sheets wrote:
On May 20, 2007, at 1:29 AM, Brad Choate wrote:
Again this is very tedious, especially for a large diff. I would be very happy if someone found a way to automate this process. Ideally, it should be possible to describe a folding marker whose end is identified by the start of a new fold, but I don't think it's possible today.
Your right it is impossible with the current folding system. We'll have to wait and see if 2.0 changes that. :)
For now this macro should do it:
<Fold Diff Documents.tmMacro.zip>
It beeps some at the end because I had to make it folded a lot of documents, but that appears to be the only downside. ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate