View Full Version : Re-align Section
Michael Bulgrien
13-Mar-2008, 08:32 PM
May 6th, 2007 at 2:27 pm (http://www.scootersoftware.com/cirrus/discussion/?p=30#comment-1066)
I really want to be able to highlight a section on the left… say align manually… and then highlight a similar section on the right.. and have it re-evaluate that whole section with those new suggestions.
This is a long time wish from earlier versions of BC. Sometimes I have need to compare two blocks of code that would not naturally align on their own. It would be nice to be able manually align entire blocks of code instead of just single lines. If the undo stack is a concern, just treat the manual block align as a group of manual aligns against consecutive line pairs. If one block is longer than the other, pad the shorter block with nulls/empty lines.
This is on our to-do list.
Rick Steinwand
07-May-2008, 09:03 AM
I have two similar files, but there's a big section in one that isn't in the other and they don't align by themselves.
How about aligning by searching the other side for the selected line?
I'd right click on the line I know is on the other side and choose "find and align on opposite side" where it searches for a line that contains the trimmed text from this side (ignoring indent).
Chris
08-May-2008, 10:10 AM
Rick,
Thanks for the suggestion. Have you tried changing your alignment settings?
With the files open in the Text Viewer, select Session|Session Settings. Go to the Alignment tab and slide the skew tolerance to "Slow and thorough". This will make BC look further in the file for matching lines to align.
Rick Steinwand
08-May-2008, 03:25 PM
Hi Chris.
It works now that you got my my VFP rule again. :cool:
geo_love
10-Jul-2009, 02:25 PM
This is on our to-do list.
Hi Tim,
Just following up on this. I ran into a situation today that this feature would address nicely. I see it's been on your to-do list for a bit now. Can you say when the feature will be released?
Thanks,
Michael Bulgrien
13-Jul-2009, 07:02 AM
Already implemented...
Select a block of lines on one side
Pess F7 (or choose Align With... from the context menu)
Select a block of lines on the other side
When you complete the selection on the second side, BC will align both selections with each other.
geo_love
13-Jul-2009, 12:14 PM
Sweet! That's exactly what I was looking for. Thanks so much.
egarcia74
22-Jul-2009, 01:16 AM
Already implemented...
Select a block of lines on one side
Pess F7 (or choose Align With... from the context menu)
Select a block of lines on the other side
When you complete the selection on the second side, BC will align both selections with each other.
Hi,
I can see that the Align With command works nicely with blocks of text - but only when performing a comparison. I have tried to do the same in a 3-way merge and for some reason this does not work - it still only aligns one line. This is frustrating, more often than not I need this feature in a merge rather than in a comparison. Is this by design? Or is this something that is yet to be implemented?
Aaron
23-Jul-2009, 12:54 PM
Hello,
The Text Merge session unfortunately does not support the same Align With features that the Text Compare session type has. Adding this functionality is on our wishlist, but is a larger project and would not be a quick change.
patrickvl
09-Apr-2010, 02:46 AM
As indicated by egarcia74, aligning a block instead of a single line is most used when merging.
Yesterday I spend about three hours on a failed attempt to merge:
I have a case in which left and right have underwent removal of some code, but not in the same sections. This results in sections that need to be aligned manually to middle, and the only way to do that is line-by-line. Even when I select a block in left and request a manual align to middle, only the last active line in the selection is aligned to the line I clicked in middle!
Sure, I know nothing about the internals, but it can't be that hard to add a loop to handle all subsequent lines in the selection in the same way as the first (applied to the following line in the target pane of course) ?
Regards, Patrick.
Aaron
09-Apr-2010, 09:52 AM
Hello,
I've added your notes to our Customer Wishlist entry.
We always appreciate specific example cases. Would you be able to email us the set of merge files you had trouble with? Please include your Support package (Help menu -> Support; Export) as well, and let us know which line section you wanted to Align (you can enable Show Line numbers and/or take a screenshot).
Our email is support@scootersoftware.com
Michael Bulgrien
11-Apr-2010, 01:00 AM
Even when I select a block in left and request a manual align to middle, only the last active line in the selection is aligned to the line I clicked in middle!
Don't just click a line in the middle. To manually align two blocks of text, select the first block of lines, manually align, then click and drag to select the second block of lines. When you let go of the click/drag to finalize the selection of the second block of lines, the two blocks will be aligned to each other.
misi01
27-May-2010, 02:21 PM
I'll attach 2 files - these are (for all intents and purposes identical).
Do a text compare on the 2. On the left-hand file, select the line "convert_cobol_via_stem:" and
press F7. For the right-hand file, look for the line containing "convert_cobol_via_array:" and selct "Align with marked".
Based on the results, one would think the files after the aligned lines were completely different (which I don't think they are).
Am I missing something here. (Tried it in BC2, but that gave the same results)
Craig
27-May-2010, 03:20 PM
Align With generally won't break existing matching line alignments. When you tell it to align two lines it looks for matching lines that are already aligned below that point and won't try to realign anything past them. I think it looks for a minimum of 10 or so lines before it decides not to go any further, but in this case it hits that right away. If you want to specifically align functions you should select the entire blocks.
misi01
27-May-2010, 11:07 PM
Mark a block in the left file, press F7, mark "similar" block in right file and select "Align with" gives the results/layout I was expecting.
Thanks again.
mcw0933
01-Jun-2010, 10:42 AM
I'm running into the exact same problem, but with a 3-way merge.
I select the section in the left file using the menu option, then do "Align With" and sweep the entire matching section in the middle file. It ends up aligning only the first line from the left section with the last selected line from the middle.
I attached 3 screenshots showing what I'm seeing. This is with version 3.1.11.
It doesn't seem to matter if I include or exclude the slashed (empty) lines when I choose the target section. Nor does it matter if I start with the middle file (I can choose the target in either side but the single-line alignment behavior is the same).
Am I just doing something wrong? I'm wondering if I compounded the problem by hand-aligning the method block directly above the method declaration seen in the screenshots?
mcw0933
01-Jun-2010, 10:46 AM
Hello,
The Text Merge session unfortunately does not support the same Align With features that the Text Compare session type has. Adding this functionality is on our wishlist, but is a larger project and would not be a quick change.
My apologies - I didn't see post #10 from Aaron on page 1 of the thread. So the "block align" capability is only in 2-way compare with the 3.1.11 build?
Aaron
02-Jun-2010, 09:13 AM
Correct. Currently the Text Merge's Align With takes the "current" line where the blinking cursor is located, and is not based on the selected text.
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.