ScooterSoftware / bcompare-vscode

Visual Studio Code extension to open Beyond Compare in several useful ways.
MIT License
7 stars 0 forks source link

Bogus middle column displayed when comparing two files #26

Open bvanderw opened 7 months ago

bvanderw commented 7 months ago

I am using the latest versions of VS Code, the extension (1.0.7), and Beyond Compare 5. I am seeing this issue on both Windows and macOS.

If I select two files and then select 'Compare Selected Items' from the BC context menu, the tab label is 'for testing purposes' and a bogus middle column is displayed (like it was a merge).

The filename actually contains the name of another file that exists in the project, but there is a File Not Found error displayed, along with this text:

/function (old_index, new_index) {
    / Shortcut helper to move item to end of array
    if (-1 === new_index) {
        new_index = this.length - 1;
    }

    if (new_index >= this.length) {
        var k = new_index - this.length;
        while (k-- + 1) {
            this.push(undefined);
        }
    }
    this.splice(new_index, 0, this.splice(old_index, 1)[0]);
    return this; / for testing purposes
}
boramis commented 7 months ago

I can't repeat that here. Can you provide some more details on what your doing and what the selection is? Are you selecting two files in the "Explorer" treeview and right clicking on one of them or opening the Beyond Compare menu a different way? If you right click on just a single file does the "Beyond Compare" menu include a "Compare to Left File" command or just "Select Left File"?

This seems like it's using the contents of a previous "Select Highlighted Text as Left File" command, but if I do that and then launch a compare as above it's still only opening a two-sided comparison for me.

Looking at the code, the only way I can see that it could trigger a 3-way comparison is if "Compare Selected" is called with a selection containing 3 files, but the command isn't enabled in that case. Maybe try uninstalling the extension, restarting VSCode, then reinstalling it?

iliyansi commented 3 months ago

I have simillar issue, i have following test scenarios:

opens "Beyond Compare with file not found and following text in the midle column

function(e,t=!1){return this.sort(((a,r)=>{const i=e(a),n=e(r),o=t?-1:1;returnstring==typeof i&&string==typeof n?oi.localeCompare(n):number==typeof i&&number==typeof n?o(i-n):0})),this}

same scenario happens if i select parent folders of the files

After disabled all extension and enabled just Beyond Compare it worked as expected. So i've enabled all extensions and start disable one at a time and for the one that causes this to happen is SARIF Viewer by Microsoft. Strange thing was that on different repository even with this extension enabled Beyond Copmare worked as expected.