Re-align Section

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Bulgrien
    Carpal Tunnel
    • Oct 2007
    • 1772

    Re-align Section

    Originally posted by Andy Stevenson
    May 6th, 2007 at 2:27 pm
    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.
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Tim
    Team Scooter
    • Oct 2007
    • 786

    #2
    This is on our to-do list.
    Tim T Scooter Software

    Comment

    • Rick Steinwand
      Expert
      • May 2008
      • 55

      #3
      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).

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        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.
        Chris K Scooter Software

        Comment

        • Rick Steinwand
          Expert
          • May 2008
          • 55

          #5
          Hi Chris.

          It works now that you got my my VFP rule again.

          Comment

          • geo_love
            Visitor
            • Jul 2009
            • 4

            #6
            Following up ... Align With [Block]

            Originally posted by Tim
            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,

            Comment

            • Michael Bulgrien
              Carpal Tunnel
              • Oct 2007
              • 1772

              #7
              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.
              BC v4.0.7 build 19761
              ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

              Comment

              • geo_love
                Visitor
                • Jul 2009
                • 4

                #8
                Sweet! That's exactly what I was looking for. Thanks so much.

                Comment

                • egarcia74
                  Visitor
                  • Jul 2009
                  • 5

                  #9
                  Originally posted by Michael Bulgrien
                  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?

                  Comment

                  • Aaron
                    Team Scooter
                    • Oct 2007
                    • 15997

                    #10
                    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.
                    Aaron P Scooter Software

                    Comment

                    • patrickvl
                      New User
                      • Apr 2010
                      • 1

                      #11
                      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.

                      Comment

                      • Aaron
                        Team Scooter
                        • Oct 2007
                        • 15997

                        #12
                        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 [email protected]
                        Aaron P Scooter Software

                        Comment

                        • Michael Bulgrien
                          Carpal Tunnel
                          • Oct 2007
                          • 1772

                          #13
                          Originally posted by patrickvl
                          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.
                          BC v4.0.7 build 19761
                          ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

                          Comment

                          • misi01
                            Old Hand
                            • Jun 2005
                            • 210

                            #14
                            Either missing smething stupid, or having problems getting align to work

                            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)

                            Comment

                            • Zoë
                              Team Scooter
                              • Oct 2007
                              • 2666

                              #15
                              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.
                              Zoë P Scooter Software

                              Comment

                              Working...