Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-33499

Show diff of two regions of the same file

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • None
    • Editors
    • None

      I sometimes have to deal with files which contain blocks of duplicated code. Or do those have subtle differences? I'd like to find out.

      To do this, it would be helpful if Creator could show me a diff for two regions of the same file, e.g. the lines following line 100 compared to the lines following line 600.

      How could this function be triggered? Some ideas:

      1. Open a file in an editor.
      2. From the menu, select "Tools" -> "Diff" -> "Diff file against itself.
        A diff viewer appear which - of course - does not show any differences yet.
      3. In a spinbox above the diff viewer, enter a line offset.
        The offset determines which lines will be compared to each other, e.g. if set to "100", line 1 will compared to line 101 and so forth.
      1. Open the same file in two editors side by side.
      2. From the menu, select "Tools" -> "Diff" -> "Diff currently visible lines.
      1. Select some lines.
      2. Right-click to open the context menu.
      3. From the menu, select "Compare selection to lines..."
        A small dialog opens.
      4. In the dialog, enter the number of the first line that will be compared to the selection.

      Of course I'm open for better suggestions.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            davschul David Schulz
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes