Announcement

Collapse
No announcement yet.

Compare selected text

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Compare selected text

    I know how to use Align With or the clipboard but I am hoping that there is a way of selecting a section of text on either side and then restricting the comparison to the selections.

    My use case is comparing code snippets in different code modules. When I open the two modules there will initially be tens or hundreds of differences but when I home in on the code fragments I am only interested in the differences, if any, in the selected sections.

  • #2
    Hello,

    The closest to this behavior is the Compare to Clipboard command, where you select and Copy one block of text, then select the other and right-click -> Compare to Clipboard. Is there a grammar definition that could match on either what you consider important or unimportant? If this could be defined, then the grammar could be marked as Important or Unimportant and Everything Else can be Important or Unimportant.
    Aaron P Scooter Software

    Comment


    • #3
      Yes, I know about the Compare to Clipboard method. I was hoping there would be a more direct way of isolating just the section I want to compare. It would amount to being able to (temporarily) exclude/ignore everything except the selected section. I have a workaround so this is not a big deal but maybe something to consider for a future release. Thanks for responding.

      Comment


      • #4
        Have you tried selecting the block on one side, then select "Align with" from the context menu, then selecting the block on the other side that you want to compare to? It doesn't restrict the comparison to just those sections, but it does do a direct compare of the two aligned blocks.

        Comment


        • #5
          Unless I am missing something or doing something wrong, Align With doesn't do anything other than align the starting line of text on both sides.

          For example, I open two different JavaScript text files and the summary at the bottom of the display identifies 26 difference se. The rest of the truncated text string is masked by "Important" in the next field and I don't know how to expand the masked field. Maybe se is the start of "sections" but that's just a guess.

          Now I use Align With to position left and right panes at the section of code I want to compare. In the left pane I have selected the 23 lines (out of 334 total lines in the left pane text file) I am interested in. The summary still says 26 difference se but in the 23 line subset I have selected there are actually no differences.

          What I am looking for is a means of ignoring/excluding everything on both sides except the selected sections. The ability to hide everything except the selections using a hide/show toggle would be a great addition. Something along the lines of:

          not interested
          not interested
          selected
          selected

          not interested
          not interested

          becomes..

          > 2 lines hidden
          selected
          selected

          > 2 lines hidden

          ..and the summary should only reflect differences in the selected lines.

          Comment


          • #6
            Align With can function on a block of text. First, select multiple lines, then right click Align With. Then, on the target side, click and drag the selection to select multiple target lines. This aligns block to block (and also moves the rest of the file around in order to make the alignment happen).
            Aaron P Scooter Software

            Comment


            • #7
              When I select a block of text on the source side and right click Align With, a turquoise bar appears to the left of the selected lines and this provides a handy visual indication of what lines are in scope. When I click and drag to define the corresponding block on the target side, the turquoise bar on the source side disappears. The source and target blocks are aligned but there is no visual marker on either side to show what constitutes the blocks.

              Comment


              • #8
                Hello,

                The gutter bars should remain visible during the clicking and dragging, but once you let go and the alignment occurs, they do disappear. It's on our wishlist to add an align with indicator, but that is not supported in the current version of BC. A Refresh will reset any align withs that have been defined.
                Aaron P Scooter Software

                Comment

                Working...
                X