Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ab option to disable the warning on large file comparison #410

Open
Julienraptor01 opened this issue Feb 16, 2025 · 1 comment
Open

Comments

@Julienraptor01
Copy link

Julienraptor01 commented Feb 16, 2025

i do very big comparison all the time and having to click on yes every single time and it's really tiring
Image
i do think that warning is a good thing by default, but should be able to be toggled off for users that know what they are doing
related to

comparePlus/src/Compare.cpp

Lines 2789 to 2817 in e08ac82

if (!recompare)
{
constexpr int cLinesCountWarningLimit = 50000;
bool largeFilesWarning = false;
if (selectionCompare)
largeFilesWarning =
(cmpPair->options.selections[MAIN_VIEW].second -
cmpPair->options.selections[MAIN_VIEW].first + 1 > cLinesCountWarningLimit) &&
(cmpPair->options.selections[SUB_VIEW].second -
cmpPair->options.selections[SUB_VIEW].first + 1 > cLinesCountWarningLimit);
else
largeFilesWarning =
(CallScintilla(MAIN_VIEW, SCI_GETLINECOUNT, 0, 0) > cLinesCountWarningLimit) &&
(CallScintilla(SUB_VIEW, SCI_GETLINECOUNT, 0, 0) > cLinesCountWarningLimit);
if (largeFilesWarning)
{
if (::MessageBox(nppData._nppHandle,
TEXT("Comparing large files such as these might take significant time ")
TEXT("especially if they differ a lot.\n\n")
TEXT("Compare anyway?"), PLUGIN_NAME, MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) != IDYES)
{
clearComparePair(getCurrentBuffId());
return;
}
}
}

@pnedev
Copy link
Owner

pnedev commented Feb 17, 2025

@Julienraptor01 ,
OK, I will add such option in the next version.
BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants