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

An option to close compared files if they match #2

Closed
Yaron10 opened this issue Mar 10, 2016 · 2 comments
Closed

An option to close compared files if they match #2

Yaron10 opened this issue Mar 10, 2016 · 2 comments

Comments

@Yaron10
Copy link

Yaron10 commented Mar 10, 2016

Replace

        if(!different)
        {
            ::MessageBox(nppData._nppHandle, TEXT("Files Match"), TEXT("Results :"), MB_OK);
            return true;
        }

with

        if (!different)
        {
            if (::MessageBox(nppData._nppHandle, TEXT("Files match.\n\nClose compared files?"), TEXT("Compare Plugin"), MB_YESNO | MB_ICONQUESTION/*  | MB_DEFBUTTON2 */) == IDYES)     // Yaron - An option to close compared files.
            {
                SendMessage(nppData._nppHandle, WM_COMMAND, IDM_FILE_CLOSE, 0);
                SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_SWITCHTO_OTHER_VIEW, 0);
                SendMessage(nppData._nppHandle, WM_COMMAND, IDM_FILE_CLOSE, 0);
                SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_SWITCHTO_OTHER_VIEW, 0);
            }

            return true;
        }

Personally I prefer "Yes" to be the default button.
Uncomment | MB_DEFBUTTON2 if you think "No" should be default.

Thank you.

@pnedev
Copy link
Owner

pnedev commented Mar 11, 2016

Merged to master branch, thanks.

@jsleroy
Copy link
Contributor

jsleroy commented Jul 23, 2016

This issue was moved to jsleroy/compare-plugin#23

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

No branches or pull requests

3 participants