In NetBeans I'd sometimes compare the some code in the same file side by side.
To get the same file opened a second time, there is a clone-Item in the right-click-menu on the tab-Item.
To see it side by side, I dragged one around to fit it side by side, but the
right-click-menu has a "New Document Tab Group". This does it automatically and
has also a "Collapse Document Tab Group".