winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

Error merging Pascal code when Ignore differences in comments option is enabled

Open JedrzejczykRobert opened this issue 5 months ago • 1 comments

Today I use CI Build, then have merge error, when use Ignore differences in comments.

For example please compare source codes:

function ddd(aAlg: TAlg): Boolean;
begin
  case aAlg of
    aaa, bbb, ccc, ddd:
      begin        
        Result := TRUE;
      end;
    {
      eee, fff, ggg:
      Result := FALSE;
    }
    hhh:
      begin
        Result := TRUE;
      end;
  else
    Result := FALSE;
  end;
end;

function ddd(aAlg: TAlg): Boolean;
begin
  case aAlg of
    aaa, bbb, ccc:
      Result := TRUE;
    {
      ddd, eee, fff:
      Result := FALSE;
    }
    ggg:
      Result := FALSE;
  else
    Result := FALSE;
  end;
end;
function ddd(aAlg: TAlg): Boolean;
begin
  case aAlg of
    aaa, bbb, ccc, ddd:
      begin        
        Result := TRUE;
      end;
    eee, fff, ggg:
      begin
        Result := FALSE;
      end;
    hhh:
      begin
        Result := TRUE;
      end;
  else
    Result := FALSE;
  end;
end;

function ddd(aAlg: TAlg): Boolean;
begin
  case aAlg of
    aaa, bbb, ccc:
      Result := TRUE;
    ddd, eee, fff:
      Result := TRUE;
    ggg:
      Result := FALSE;
  else
    Result := FALSE;
  end;
end;
Image

after merge using "Copy all to left" or "Copy to left then go to next diff" have:

Image

JedrzejczykRobert avatar Jul 11 '25 05:07 JedrzejczykRobert

Hmm. WinMerge does not copy lines with only ignored differences, so this behavior is expected. What result were you expecting?

sdottaka avatar Jul 13 '25 21:07 sdottaka