Coder Social home page Coder Social logo

compare-plugin's Introduction

Hi ๐Ÿ‘‹, I'm Jean

C C++ Python SQLite Git Linux Docker SCons Arduino

Bitwig

Jean's GitHub stats

compare-plugin's People

Contributors

chcg avatar jsleroy avatar pnedev avatar xylographe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compare-plugin's Issues

Thank you

Hello jsleroy,

Ede123 has kindly referred me to this repo.

I regularly use Compare and I'd like to sincerely thank you for your great work.

I'm about to open some issues here and I (and many others) would highly appreciate it if you could find some time to have a look and help.
The Compare Plugin is indispensable and your country needs you! :)

Best regards.

[CLOSED] Compare current and previous files and place current in the top view

Issue by Yaron10
Thursday Mar 10, 2016 at 19:05 GMT
Originally opened as pnedev/comparePlus#1


When comparing In One-View mode, the current file and the previous file should be compared.
Also, the current file should always get the top (or left) view.

NOTE:
This fix (current at top) does not address "Compare to last Save".
I've never used "Compare to Git".


Replace

    if(!IsWindowVisible(nppData._scintillaMainHandle) || !IsWindowVisible(nppData._scintillaSecondHandle))
    {   
        skipAutoReset = true;
        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_GOTO_ANOTHER_VIEW, 0);
        skipAutoReset = false;
        panelsOpened = true;
    }

with

    if(!IsWindowVisible(nppData._scintillaMainHandle) || !IsWindowVisible(nppData._scintillaSecondHandle))  // Yaron - One-View mode.
    {
        skipAutoReset = true;

        // Yaron - In One-View mode, the current view can be 0 or 1.
        // In Two-Views mode, the top (or left) view is ALWAYS 0, and the bottom view is ALWAYS 1.
        int currentView = SendMessage(nppData._nppHandle, NPPM_GETCURRENTVIEW, 0, 0);
        LRESULT bufferID = SendMessage(nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0);

        // Yaron - If the current view is 0, we want the prev file to be moved to the bottom; if the current view is 1, we still need to activate it and make sure it's compared to the current file.
        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_TAB_PREV, 0);

        if(currentView == 1)
        {
            bufferID = SendMessage(nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0);
            SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_TAB_NEXT, 0);      // Yaron - Switch back to current file.
        }

        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_GOTO_ANOTHER_VIEW, 0);     // Yaron - Current file is ALWAYS at top, and prev file is ALWAYS at bottom.

        activateBufferID(bufferID, currentView);        // Yaron - If the current view is 0, activate current file at top; if the current view is 1, activate prev file at bottom (possibly multiple files there).

        if (currentView == 1)
            SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_SWITCHTO_OTHER_VIEW, 0);       // Yaron - Activate current file at top.

        skipAutoReset = false;
        panelsOpened = true;
    }

and add the following function

void activateBufferID(LRESULT bufferID, int view)
{
    LRESULT index = SendMessage(nppData._nppHandle, NPPM_GETPOSFROMBUFFERID, bufferID, view);
    index = index & 0x3FFFFFFF;

    SendMessage(nppData._nppHandle, NPPM_ACTIVATEDOC, view, index);
}

Thank you.

Restore One-View mode after Clear Result

STR:

  1. Start NPP with no files (Session etc.).
  2. Open two files (One-View mode; current view is 0).
  3. Press "Move to Other View" (we switch to Tow-Views mode; current file is in view 1 (BOTTOM), and the second file is in view 0 (TOP)).
  4. Activate the file at top, and press "Move to Other View" (we switch to One-View mode; current view is 1).
  5. Open a third file.
  6. Compare.
  7. Clear Results.

Result:
We're still in Two-Views mode.

[Enhancement] A new extra Status Bar for Compare

Issue by Yaron10
Friday Mar 18, 2016 at 02:30 GMT
Originally opened as pnedev/comparePlus#16


A new extra Status Bar for Compare could be useful.

It should have the following segments:

  1. Total diffs.

  2. No. of added lines.

  3. No. of removed lines.

  4. No. of not equal lines.

  5. No. of moved lines.

  6. Various messages: "No files to compare.", "Can not locate Git." etc.

  7. A small Progress Bar.
    Pressing "Clear Results" should terminate the process and close the status bar.


Originally opened in:
#9

Keyboard Shortcut problem

Hello,

in the last version of the plugin the new keyboard shortcut (Ctrl+Alt+C) is causing my OS ( Windows 7 and 10) to open the shutdown dialog after closing all my opened application, while the old combination (Alt+D) was working fine.
Is possible to have an option to set the shortcuts?

[CLOSED] Fix Shortcuts and modify some Text Stings

Issue by Yaron10
Thursday Mar 10, 2016 at 19:06 GMT
Originally opened as pnedev/comparePlus#3


Replace

            funcItem[CMD_COMPARE_LAST_SAVE]._pFunc = compareLocal;
            lstrcpy(funcItem[CMD_COMPARE_LAST_SAVE]._itemName, TEXT("Compare to last save"));
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isCtrl = false;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_key = 'S';
            funcItem[CMD_COMPARE_LAST_SAVE]._init2Check = false;

            funcItem[CMD_COMPARE_SVN_BASE]._pFunc = compareSvnBase;
            lstrcpy(funcItem[CMD_COMPARE_SVN_BASE]._itemName, TEXT("Compare against SVN base"));
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isCtrl = false;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_key = 'B';
            funcItem[CMD_COMPARE_SVN_BASE]._init2Check = false;

            funcItem[CMD_COMPARE_GIT_BASE]._pFunc = compareGitBase;
            lstrcpy(funcItem[CMD_COMPARE_GIT_BASE]._itemName, TEXT("Compare against GIT base"));
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isCtrl = true;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_key = 'B';
            funcItem[CMD_COMPARE_GIT_BASE]._init2Check = false;

            funcItem[CMD_SEPARATOR_2]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_2]._itemName, TEXT("------------"));
            funcItem[CMD_SEPARATOR_2]._pShKey = NULL;

            funcItem[CMD_ALIGN_MATCHES]._pFunc = alignMatches;
            lstrcpy(funcItem[CMD_ALIGN_MATCHES]._itemName, TEXT("Align Matches"));
            funcItem[CMD_ALIGN_MATCHES]._pShKey = NULL;
            funcItem[CMD_ALIGN_MATCHES]._init2Check = false;

            funcItem[CMD_IGNORE_SPACING]._pFunc = includeSpacing;
            lstrcpy(funcItem[CMD_IGNORE_SPACING]._itemName, TEXT("Ignore Spacing"));
            funcItem[CMD_IGNORE_SPACING]._pShKey = NULL;
            funcItem[CMD_IGNORE_SPACING]._init2Check = false;

            funcItem[CMD_DETECT_MOVES]._pFunc = detectMoves;
            lstrcpy(funcItem[CMD_DETECT_MOVES]._itemName, TEXT("Detect Moves"));
            funcItem[CMD_DETECT_MOVES]._pShKey = NULL;
            funcItem[CMD_DETECT_MOVES]._init2Check = false;

            funcItem[CMD_USE_NAV_BAR]._pFunc = ViewNavigationBar;
            lstrcpy(funcItem[CMD_USE_NAV_BAR]._itemName, TEXT("Navigation bar"));
            funcItem[CMD_USE_NAV_BAR]._pShKey = NULL;
            funcItem[CMD_USE_NAV_BAR]._init2Check = false;

            funcItem[CMD_SEPARATOR_3]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_3]._itemName, TEXT("-----------"));
            funcItem[CMD_SEPARATOR_3]._pShKey = NULL;

            funcItem[CMD_PREV]._pFunc = Prev;
            lstrcpy(funcItem[CMD_PREV]._itemName, TEXT("Previous"));
            funcItem[CMD_PREV]._pShKey = new ShortcutKey;
            funcItem[CMD_PREV]._pShKey->_isAlt = false;
            funcItem[CMD_PREV]._pShKey->_isCtrl = true;
            funcItem[CMD_PREV]._pShKey->_isShift = false;
            funcItem[CMD_PREV]._pShKey->_key = VK_PRIOR;
            funcItem[CMD_PREV]._init2Check = false;

            funcItem[CMD_NEXT]._pFunc = Next;
            lstrcpy(funcItem[CMD_NEXT]._itemName, TEXT("Next"));
            funcItem[CMD_NEXT]._pShKey = new ShortcutKey;
            funcItem[CMD_NEXT]._pShKey->_isAlt = false;
            funcItem[CMD_NEXT]._pShKey->_isCtrl = true;
            funcItem[CMD_NEXT]._pShKey->_isShift = false;
            funcItem[CMD_NEXT]._pShKey->_key = VK_NEXT;
            funcItem[CMD_NEXT]._init2Check = false;

            funcItem[CMD_FIRST]._pFunc = First;
            lstrcpy(funcItem[CMD_FIRST]._itemName, TEXT("First"));
            funcItem[CMD_FIRST]._pShKey = new ShortcutKey;
            funcItem[CMD_FIRST]._pShKey->_isAlt = false;
            funcItem[CMD_FIRST]._pShKey->_isCtrl = true;
            funcItem[CMD_FIRST]._pShKey->_isShift = true;
            funcItem[CMD_FIRST]._pShKey->_key = VK_PRIOR;
            funcItem[CMD_FIRST]._init2Check = false;

            funcItem[CMD_LAST]._pFunc = Last;
            lstrcpy(funcItem[CMD_LAST]._itemName, TEXT("Last"));
            funcItem[CMD_LAST]._pShKey = new ShortcutKey;
            funcItem[CMD_LAST]._pShKey->_isAlt = false;
            funcItem[CMD_LAST]._pShKey->_isCtrl = true;
            funcItem[CMD_LAST]._pShKey->_isShift = true;
            funcItem[CMD_LAST]._pShKey->_key = VK_NEXT;
            funcItem[CMD_LAST]._init2Check = false;

            funcItem[CMD_SEPARATOR_4]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_4]._itemName, TEXT("-----------"));
            funcItem[CMD_SEPARATOR_4]._pShKey = NULL;

            funcItem[CMD_OPTION]._pFunc = openOptionDlg;
            lstrcpy(funcItem[CMD_OPTION]._itemName, TEXT("Option"));
            funcItem[CMD_OPTION]._pShKey = NULL;
            funcItem[CMD_OPTION]._init2Check = false;

with

        funcItem[CMD_COMPARE_LAST_SAVE]._pFunc = compareLocal;
        lstrcpy(funcItem[CMD_COMPARE_LAST_SAVE]._itemName, TEXT("Compare to last Save"));
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isCtrl = false;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_key = 'S';
        funcItem[CMD_COMPARE_LAST_SAVE]._init2Check = false;

        funcItem[CMD_COMPARE_SVN_BASE]._pFunc = compareSvnBase;
        lstrcpy(funcItem[CMD_COMPARE_SVN_BASE]._itemName, TEXT("Compare to SVN base"));
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isCtrl = false;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_key = 'B';
        funcItem[CMD_COMPARE_SVN_BASE]._init2Check = false;

        funcItem[CMD_COMPARE_GIT_BASE]._pFunc = compareGitBase;
        lstrcpy(funcItem[CMD_COMPARE_GIT_BASE]._itemName, TEXT("Compare to GIT base"));
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isCtrl = true;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_key = 'G'; // Yaron
        funcItem[CMD_COMPARE_GIT_BASE]._init2Check = false;

        funcItem[CMD_SEPARATOR_2]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_2]._itemName, TEXT("------------"));
        funcItem[CMD_SEPARATOR_2]._pShKey = NULL;

        funcItem[CMD_ALIGN_MATCHES]._pFunc = alignMatches;
        lstrcpy(funcItem[CMD_ALIGN_MATCHES]._itemName, TEXT("Align Matches"));
        funcItem[CMD_ALIGN_MATCHES]._pShKey = NULL;
        funcItem[CMD_ALIGN_MATCHES]._init2Check = false;

        funcItem[CMD_IGNORE_SPACING]._pFunc = includeSpacing;
        lstrcpy(funcItem[CMD_IGNORE_SPACING]._itemName, TEXT("Ignore Spacing"));
        funcItem[CMD_IGNORE_SPACING]._pShKey = NULL;
        funcItem[CMD_IGNORE_SPACING]._init2Check = false;

        funcItem[CMD_DETECT_MOVES]._pFunc = detectMoves;
        lstrcpy(funcItem[CMD_DETECT_MOVES]._itemName, TEXT("Detect Moves"));
        funcItem[CMD_DETECT_MOVES]._pShKey = NULL;
        funcItem[CMD_DETECT_MOVES]._init2Check = false;

        funcItem[CMD_USE_NAV_BAR]._pFunc = ViewNavigationBar;
        lstrcpy(funcItem[CMD_USE_NAV_BAR]._itemName, TEXT("Navigation Bar"));
        funcItem[CMD_USE_NAV_BAR]._pShKey = NULL;
        funcItem[CMD_USE_NAV_BAR]._init2Check = false;

        funcItem[CMD_SEPARATOR_3]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_3]._itemName, TEXT("-----------"));
        funcItem[CMD_SEPARATOR_3]._pShKey = NULL;

        funcItem[CMD_PREV]._pFunc = Prev;
        lstrcpy(funcItem[CMD_PREV]._itemName, TEXT("Previous"));
        funcItem[CMD_PREV]._pShKey = new ShortcutKey;
        funcItem[CMD_PREV]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_PREV]._pShKey->_isCtrl = false;
        funcItem[CMD_PREV]._pShKey->_isShift = false;
        funcItem[CMD_PREV]._pShKey->_key = VK_PRIOR;
        funcItem[CMD_PREV]._init2Check = false;

        funcItem[CMD_NEXT]._pFunc = Next;
        lstrcpy(funcItem[CMD_NEXT]._itemName, TEXT("Next"));
        funcItem[CMD_NEXT]._pShKey = new ShortcutKey;
        funcItem[CMD_NEXT]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_NEXT]._pShKey->_isCtrl = false;
        funcItem[CMD_NEXT]._pShKey->_isShift = false;
        funcItem[CMD_NEXT]._pShKey->_key = VK_NEXT;
        funcItem[CMD_NEXT]._init2Check = false;

        funcItem[CMD_FIRST]._pFunc = First;
        lstrcpy(funcItem[CMD_FIRST]._itemName, TEXT("First"));
        funcItem[CMD_FIRST]._pShKey = new ShortcutKey;
        funcItem[CMD_FIRST]._pShKey->_isAlt = true; // Yaron
        funcItem[CMD_FIRST]._pShKey->_isCtrl = true;
        funcItem[CMD_FIRST]._pShKey->_isShift = false;
        funcItem[CMD_FIRST]._pShKey->_key = VK_PRIOR;
        funcItem[CMD_FIRST]._init2Check = false;

        funcItem[CMD_LAST]._pFunc = Last;
        lstrcpy(funcItem[CMD_LAST]._itemName, TEXT("Last"));
        funcItem[CMD_LAST]._pShKey = new ShortcutKey;
        funcItem[CMD_LAST]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_LAST]._pShKey->_isCtrl = true;
        funcItem[CMD_LAST]._pShKey->_isShift = false;
        funcItem[CMD_LAST]._pShKey->_key = VK_NEXT;
        funcItem[CMD_LAST]._init2Check = false;

        funcItem[CMD_SEPARATOR_4]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_4]._itemName, TEXT("-----------"));
        funcItem[CMD_SEPARATOR_4]._pShKey = NULL;

        funcItem[CMD_OPTION]._pFunc = openOptionDlg;
        lstrcpy(funcItem[CMD_OPTION]._itemName, TEXT("Options"));   // Yaron
        funcItem[CMD_OPTION]._pShKey = NULL;
        funcItem[CMD_OPTION]._init2Check = false;

Thank you.

Shortcut key change conflict

I downloaded the latest version of Notepad++ (7.3.2) and Compare plugin (2.0.0). I noticed that the shortcut keys are changed (like instead of ALT+D I have to do CTRL+ALT+C) I also noticed that CTRL+ALT+SHIFT+X that is supposed to clear all compares is a reserved shortcut for Notepad++ (RUN -> Launch in FireFox). Now the question is, is there a way to customize the shortcut keys? and if yes, How?

[CLOSED] Compare current and previous files and place current in the top view

Issue by Yaron10
Thursday Mar 10, 2016 at 19:05 GMT
Originally opened as pnedev/comparePlus#1


When comparing In One-View mode, the current file and the previous file should be compared.
Also, the current file should always get the top (or left) view.

NOTE:
This fix (current at top) does not address "Compare to last Save".
I've never used "Compare to Git".


Replace

    if(!IsWindowVisible(nppData._scintillaMainHandle) || !IsWindowVisible(nppData._scintillaSecondHandle))
    {   
        skipAutoReset = true;
        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_GOTO_ANOTHER_VIEW, 0);
        skipAutoReset = false;
        panelsOpened = true;
    }

with

    if(!IsWindowVisible(nppData._scintillaMainHandle) || !IsWindowVisible(nppData._scintillaSecondHandle))  // Yaron - One-View mode.
    {
        skipAutoReset = true;

        // Yaron - In One-View mode, the current view can be 0 or 1.
        // In Two-Views mode, the top (or left) view is ALWAYS 0, and the bottom view is ALWAYS 1.
        int currentView = SendMessage(nppData._nppHandle, NPPM_GETCURRENTVIEW, 0, 0);
        LRESULT bufferID = SendMessage(nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0);

        // Yaron - If the current view is 0, we want the prev file to be moved to the bottom; if the current view is 1, we still need to activate it and make sure it's compared to the current file.
        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_TAB_PREV, 0);

        if(currentView == 1)
        {
            bufferID = SendMessage(nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0);
            SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_TAB_NEXT, 0);      // Yaron - Switch back to current file.
        }

        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_GOTO_ANOTHER_VIEW, 0);     // Yaron - Current file is ALWAYS at top, and prev file is ALWAYS at bottom.

        activateBufferID(bufferID, currentView);        // Yaron - If the current view is 0, activate current file at top; if the current view is 1, activate prev file at bottom (possibly multiple files there).

        if (currentView == 1)
            SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_SWITCHTO_OTHER_VIEW, 0);       // Yaron - Activate current file at top.

        skipAutoReset = false;
        panelsOpened = true;
    }

and add the following function

void activateBufferID(LRESULT bufferID, int view)
{
    LRESULT index = SendMessage(nppData._nppHandle, NPPM_GETPOSFROMBUFFERID, bufferID, view);
    index = index & 0x3FFFFFFF;

    SendMessage(nppData._nppHandle, NPPM_ACTIVATEDOC, view, index);
}

Thank you.

[CLOSED] An option to close compared files if they match

Issue by Yaron10
Thursday Mar 10, 2016 at 19:05 GMT
Originally opened as pnedev/comparePlus#2


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.

Compare does not work with 64-bit Notepad++

When I tried to load ComparePlugin.dll into the plugins directory and start Notepad++ I received the following error:
compareplugin dll

is there a plan to port this for 64-bit Notepad++ and what is the timeframe if so?

thanks for your GREAT Work!

Feature Request: Export Results

I have been using this plugin with fantastic results for a few years. I'd really like to be able to export the results in WYSIWYG fashion to html or pdf (or anything, really), so that I can share them with my clients.

Syntax highlighting lost after and during comare

From Notepad++ 6.x on, syntax highlighting is lost upon comparison of files. There are several bug reports about it on Source Forge. Possibly you din't see them, yet. For example this one:

http://sourceforge.net/p/notepad-plus/bugs/4119/

Reverting to previous older of your awesome Compare Plugin doesn't fix the issue. If you're still working on this project, this fix would be really great and useful to lots of users in the "npp community" If you can point me into a direction, I'd try finding the cause myself, but I'm a beginner concerning C++ :-/

Also, it would be great having the binaries/DLLs for version 1.5.7
http://sourceforge.net/projects/npp-compare/forums/forum/1815517/topic/6628399

Cheers,
Simon

View files order changes after compare

Issue by xylographe
Tuesday Apr 12, 2016 at 01:57 GMT
Originally opened as pnedev/comparePlus#47


In single view the order of files is changed after "Clear Compare". This behaviour is rather annoying. ๐Ÿ˜‰
It would be desirable to restore the original file order after compare.

Example 1:

  • single view, four files open: A, B, C, D (from left to right)
  • activate file B, and press Alt+F
  • activate file C, and press Alt+D
  • press Alt+Shift+D (back to single view)

The file order has changed to A, B, D, C (from left to right).

Example 2:

  • single view, four files open: A, B, C, D (from left to right)
  • activate file A, and press Alt+F
  • activate file B, and press Alt+D
  • press Alt+Shift+D (back to single view)

The file order has changed to A, C, D, B.

[originally inappropriately reported in this comment]

[CLOSED] Some minor code optimization

Issue by Yaron10
Thursday Mar 10, 2016 at 19:06 GMT
Originally opened as pnedev/comparePlus#5


Replace

    /* sync pannels */
    HMENU hMenu = ::GetMenu(nppData._nppHandle);

    syncScrollVwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLV, MF_BYCOMMAND) & MF_CHECKED) != 0;
    syncScrollHwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLH, MF_BYCOMMAND) & MF_CHECKED) != 0;
    if (syncScrollVwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);
    if (syncScrollHwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

    // let the second view inherit the zoom level of the main view
    int mainZoomLevel = SendMessage(nppData._scintillaMainHandle, SCI_GETZOOM, 0, 0);
    SendMessage(nppData._scintillaSecondHandle, SCI_SETZOOM, mainZoomLevel, 0);

    ::SendMessageA(nppData._scintillaMainHandle, SCI_GOTOPOS, 1, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_GOTOPOS, 1, 0);
    ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);
    ::SendMessageA(nppData._scintillaMainHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);

with

    // Yaron - Change code location.
    ::SendMessageA(nppData._scintillaMainHandle, SCI_GOTOPOS, 0, 0);    // Yaron - pos 0, 0. Why 1, 0?
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_GOTOPOS, 0, 0);
    //::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);       // Yaron - Not nedded.
    ::SendMessageA(nppData._scintillaMainHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);

    /* sync pannels */

    HMENU hMenu = ::GetMenu(nppData._nppHandle);

    syncScrollVwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLV, MF_BYCOMMAND) & MF_CHECKED) != 0;
    syncScrollHwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLH, MF_BYCOMMAND) & MF_CHECKED) != 0;

    if (syncScrollVwasChecked)      // Yaron - Disable vertical scroll sync. Use "case SCN_UPDATEUI:".
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);
    if (!syncScrollHwasChecked)     // Yaron - Enable horizontal scroll sync.
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

    // let the second view inherit the zoom level of the main view
    int mainZoomLevel = SendMessage(nppData._scintillaMainHandle, SCI_GETZOOM, 0, 0);
    SendMessage(nppData._scintillaSecondHandle, SCI_SETZOOM, mainZoomLevel, 0);

Why call

    if (syncScrollHwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

and then again
::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);
? - Do it once.

NOTE: I've also changed SCI_GOTOPOS, 1, 0); to SCI_GOTOPOS, 0, 0);.
What do you think?

Thank you.

An option to close compared files if they match

From @Yaron10 on March 10, 2016 19:5

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.

Copied from original issue: pnedev/comparePlus#2

Fix Shortcuts and modify some Text Stings

From @Yaron10 on March 10, 2016 19:6

Replace

            funcItem[CMD_COMPARE_LAST_SAVE]._pFunc = compareLocal;
            lstrcpy(funcItem[CMD_COMPARE_LAST_SAVE]._itemName, TEXT("Compare to last save"));
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isCtrl = false;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_key = 'S';
            funcItem[CMD_COMPARE_LAST_SAVE]._init2Check = false;

            funcItem[CMD_COMPARE_SVN_BASE]._pFunc = compareSvnBase;
            lstrcpy(funcItem[CMD_COMPARE_SVN_BASE]._itemName, TEXT("Compare against SVN base"));
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isCtrl = false;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_key = 'B';
            funcItem[CMD_COMPARE_SVN_BASE]._init2Check = false;

            funcItem[CMD_COMPARE_GIT_BASE]._pFunc = compareGitBase;
            lstrcpy(funcItem[CMD_COMPARE_GIT_BASE]._itemName, TEXT("Compare against GIT base"));
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isCtrl = true;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_key = 'B';
            funcItem[CMD_COMPARE_GIT_BASE]._init2Check = false;

            funcItem[CMD_SEPARATOR_2]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_2]._itemName, TEXT("------------"));
            funcItem[CMD_SEPARATOR_2]._pShKey = NULL;

            funcItem[CMD_ALIGN_MATCHES]._pFunc = alignMatches;
            lstrcpy(funcItem[CMD_ALIGN_MATCHES]._itemName, TEXT("Align Matches"));
            funcItem[CMD_ALIGN_MATCHES]._pShKey = NULL;
            funcItem[CMD_ALIGN_MATCHES]._init2Check = false;

            funcItem[CMD_IGNORE_SPACING]._pFunc = includeSpacing;
            lstrcpy(funcItem[CMD_IGNORE_SPACING]._itemName, TEXT("Ignore Spacing"));
            funcItem[CMD_IGNORE_SPACING]._pShKey = NULL;
            funcItem[CMD_IGNORE_SPACING]._init2Check = false;

            funcItem[CMD_DETECT_MOVES]._pFunc = detectMoves;
            lstrcpy(funcItem[CMD_DETECT_MOVES]._itemName, TEXT("Detect Moves"));
            funcItem[CMD_DETECT_MOVES]._pShKey = NULL;
            funcItem[CMD_DETECT_MOVES]._init2Check = false;

            funcItem[CMD_USE_NAV_BAR]._pFunc = ViewNavigationBar;
            lstrcpy(funcItem[CMD_USE_NAV_BAR]._itemName, TEXT("Navigation bar"));
            funcItem[CMD_USE_NAV_BAR]._pShKey = NULL;
            funcItem[CMD_USE_NAV_BAR]._init2Check = false;

            funcItem[CMD_SEPARATOR_3]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_3]._itemName, TEXT("-----------"));
            funcItem[CMD_SEPARATOR_3]._pShKey = NULL;

            funcItem[CMD_PREV]._pFunc = Prev;
            lstrcpy(funcItem[CMD_PREV]._itemName, TEXT("Previous"));
            funcItem[CMD_PREV]._pShKey = new ShortcutKey;
            funcItem[CMD_PREV]._pShKey->_isAlt = false;
            funcItem[CMD_PREV]._pShKey->_isCtrl = true;
            funcItem[CMD_PREV]._pShKey->_isShift = false;
            funcItem[CMD_PREV]._pShKey->_key = VK_PRIOR;
            funcItem[CMD_PREV]._init2Check = false;

            funcItem[CMD_NEXT]._pFunc = Next;
            lstrcpy(funcItem[CMD_NEXT]._itemName, TEXT("Next"));
            funcItem[CMD_NEXT]._pShKey = new ShortcutKey;
            funcItem[CMD_NEXT]._pShKey->_isAlt = false;
            funcItem[CMD_NEXT]._pShKey->_isCtrl = true;
            funcItem[CMD_NEXT]._pShKey->_isShift = false;
            funcItem[CMD_NEXT]._pShKey->_key = VK_NEXT;
            funcItem[CMD_NEXT]._init2Check = false;

            funcItem[CMD_FIRST]._pFunc = First;
            lstrcpy(funcItem[CMD_FIRST]._itemName, TEXT("First"));
            funcItem[CMD_FIRST]._pShKey = new ShortcutKey;
            funcItem[CMD_FIRST]._pShKey->_isAlt = false;
            funcItem[CMD_FIRST]._pShKey->_isCtrl = true;
            funcItem[CMD_FIRST]._pShKey->_isShift = true;
            funcItem[CMD_FIRST]._pShKey->_key = VK_PRIOR;
            funcItem[CMD_FIRST]._init2Check = false;

            funcItem[CMD_LAST]._pFunc = Last;
            lstrcpy(funcItem[CMD_LAST]._itemName, TEXT("Last"));
            funcItem[CMD_LAST]._pShKey = new ShortcutKey;
            funcItem[CMD_LAST]._pShKey->_isAlt = false;
            funcItem[CMD_LAST]._pShKey->_isCtrl = true;
            funcItem[CMD_LAST]._pShKey->_isShift = true;
            funcItem[CMD_LAST]._pShKey->_key = VK_NEXT;
            funcItem[CMD_LAST]._init2Check = false;

            funcItem[CMD_SEPARATOR_4]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_4]._itemName, TEXT("-----------"));
            funcItem[CMD_SEPARATOR_4]._pShKey = NULL;

            funcItem[CMD_OPTION]._pFunc = openOptionDlg;
            lstrcpy(funcItem[CMD_OPTION]._itemName, TEXT("Option"));
            funcItem[CMD_OPTION]._pShKey = NULL;
            funcItem[CMD_OPTION]._init2Check = false;

with

        funcItem[CMD_COMPARE_LAST_SAVE]._pFunc = compareLocal;
        lstrcpy(funcItem[CMD_COMPARE_LAST_SAVE]._itemName, TEXT("Compare to last Save"));
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isCtrl = false;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_key = 'S';
        funcItem[CMD_COMPARE_LAST_SAVE]._init2Check = false;

        funcItem[CMD_COMPARE_SVN_BASE]._pFunc = compareSvnBase;
        lstrcpy(funcItem[CMD_COMPARE_SVN_BASE]._itemName, TEXT("Compare to SVN base"));
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isCtrl = false;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_key = 'B';
        funcItem[CMD_COMPARE_SVN_BASE]._init2Check = false;

        funcItem[CMD_COMPARE_GIT_BASE]._pFunc = compareGitBase;
        lstrcpy(funcItem[CMD_COMPARE_GIT_BASE]._itemName, TEXT("Compare to GIT base"));
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isCtrl = true;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_key = 'G'; // Yaron
        funcItem[CMD_COMPARE_GIT_BASE]._init2Check = false;

        funcItem[CMD_SEPARATOR_2]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_2]._itemName, TEXT("------------"));
        funcItem[CMD_SEPARATOR_2]._pShKey = NULL;

        funcItem[CMD_ALIGN_MATCHES]._pFunc = alignMatches;
        lstrcpy(funcItem[CMD_ALIGN_MATCHES]._itemName, TEXT("Align Matches"));
        funcItem[CMD_ALIGN_MATCHES]._pShKey = NULL;
        funcItem[CMD_ALIGN_MATCHES]._init2Check = false;

        funcItem[CMD_IGNORE_SPACING]._pFunc = includeSpacing;
        lstrcpy(funcItem[CMD_IGNORE_SPACING]._itemName, TEXT("Ignore Spacing"));
        funcItem[CMD_IGNORE_SPACING]._pShKey = NULL;
        funcItem[CMD_IGNORE_SPACING]._init2Check = false;

        funcItem[CMD_DETECT_MOVES]._pFunc = detectMoves;
        lstrcpy(funcItem[CMD_DETECT_MOVES]._itemName, TEXT("Detect Moves"));
        funcItem[CMD_DETECT_MOVES]._pShKey = NULL;
        funcItem[CMD_DETECT_MOVES]._init2Check = false;

        funcItem[CMD_USE_NAV_BAR]._pFunc = ViewNavigationBar;
        lstrcpy(funcItem[CMD_USE_NAV_BAR]._itemName, TEXT("Navigation Bar"));
        funcItem[CMD_USE_NAV_BAR]._pShKey = NULL;
        funcItem[CMD_USE_NAV_BAR]._init2Check = false;

        funcItem[CMD_SEPARATOR_3]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_3]._itemName, TEXT("-----------"));
        funcItem[CMD_SEPARATOR_3]._pShKey = NULL;

        funcItem[CMD_PREV]._pFunc = Prev;
        lstrcpy(funcItem[CMD_PREV]._itemName, TEXT("Previous"));
        funcItem[CMD_PREV]._pShKey = new ShortcutKey;
        funcItem[CMD_PREV]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_PREV]._pShKey->_isCtrl = false;
        funcItem[CMD_PREV]._pShKey->_isShift = false;
        funcItem[CMD_PREV]._pShKey->_key = VK_PRIOR;
        funcItem[CMD_PREV]._init2Check = false;

        funcItem[CMD_NEXT]._pFunc = Next;
        lstrcpy(funcItem[CMD_NEXT]._itemName, TEXT("Next"));
        funcItem[CMD_NEXT]._pShKey = new ShortcutKey;
        funcItem[CMD_NEXT]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_NEXT]._pShKey->_isCtrl = false;
        funcItem[CMD_NEXT]._pShKey->_isShift = false;
        funcItem[CMD_NEXT]._pShKey->_key = VK_NEXT;
        funcItem[CMD_NEXT]._init2Check = false;

        funcItem[CMD_FIRST]._pFunc = First;
        lstrcpy(funcItem[CMD_FIRST]._itemName, TEXT("First"));
        funcItem[CMD_FIRST]._pShKey = new ShortcutKey;
        funcItem[CMD_FIRST]._pShKey->_isAlt = true; // Yaron
        funcItem[CMD_FIRST]._pShKey->_isCtrl = true;
        funcItem[CMD_FIRST]._pShKey->_isShift = false;
        funcItem[CMD_FIRST]._pShKey->_key = VK_PRIOR;
        funcItem[CMD_FIRST]._init2Check = false;

        funcItem[CMD_LAST]._pFunc = Last;
        lstrcpy(funcItem[CMD_LAST]._itemName, TEXT("Last"));
        funcItem[CMD_LAST]._pShKey = new ShortcutKey;
        funcItem[CMD_LAST]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_LAST]._pShKey->_isCtrl = true;
        funcItem[CMD_LAST]._pShKey->_isShift = false;
        funcItem[CMD_LAST]._pShKey->_key = VK_NEXT;
        funcItem[CMD_LAST]._init2Check = false;

        funcItem[CMD_SEPARATOR_4]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_4]._itemName, TEXT("-----------"));
        funcItem[CMD_SEPARATOR_4]._pShKey = NULL;

        funcItem[CMD_OPTION]._pFunc = openOptionDlg;
        lstrcpy(funcItem[CMD_OPTION]._itemName, TEXT("Options"));   // Yaron
        funcItem[CMD_OPTION]._pShKey = NULL;
        funcItem[CMD_OPTION]._init2Check = false;

Thank you.

Copied from original issue: pnedev/comparePlus#3

"nul" is added when comparing a cloned empty file

STR:

  1. Clone and Move to Other View a new empty file.
  2. Compare.

Result:
"nul" is added to the files.

Apparently, a comparison shouldn't happen at all when the 2 views contain the same file cloned.

Some minor code optimization

From @Yaron10 on March 10, 2016 19:6

Replace

    /* sync pannels */
    HMENU hMenu = ::GetMenu(nppData._nppHandle);

    syncScrollVwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLV, MF_BYCOMMAND) & MF_CHECKED) != 0;
    syncScrollHwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLH, MF_BYCOMMAND) & MF_CHECKED) != 0;
    if (syncScrollVwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);
    if (syncScrollHwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

    // let the second view inherit the zoom level of the main view
    int mainZoomLevel = SendMessage(nppData._scintillaMainHandle, SCI_GETZOOM, 0, 0);
    SendMessage(nppData._scintillaSecondHandle, SCI_SETZOOM, mainZoomLevel, 0);

    ::SendMessageA(nppData._scintillaMainHandle, SCI_GOTOPOS, 1, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_GOTOPOS, 1, 0);
    ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);
    ::SendMessageA(nppData._scintillaMainHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);

with

    // Yaron - Change code location.
    ::SendMessageA(nppData._scintillaMainHandle, SCI_GOTOPOS, 0, 0);    // Yaron - pos 0, 0. Why 1, 0?
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_GOTOPOS, 0, 0);
    //::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);       // Yaron - Not nedded.
    ::SendMessageA(nppData._scintillaMainHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);

    /* sync pannels */

    HMENU hMenu = ::GetMenu(nppData._nppHandle);

    syncScrollVwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLV, MF_BYCOMMAND) & MF_CHECKED) != 0;
    syncScrollHwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLH, MF_BYCOMMAND) & MF_CHECKED) != 0;

    if (syncScrollVwasChecked)      // Yaron - Disable vertical scroll sync. Use "case SCN_UPDATEUI:".
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);
    if (!syncScrollHwasChecked)     // Yaron - Enable horizontal scroll sync.
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

    // let the second view inherit the zoom level of the main view
    int mainZoomLevel = SendMessage(nppData._scintillaMainHandle, SCI_GETZOOM, 0, 0);
    SendMessage(nppData._scintillaSecondHandle, SCI_SETZOOM, mainZoomLevel, 0);

Why call

    if (syncScrollHwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

and then again
::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);
? - Do it once.

NOTE: I've also changed SCI_GOTOPOS, 1, 0); to SCI_GOTOPOS, 0, 0);.
What do you think?

Thank you.

Copied from original issue: pnedev/comparePlus#5

[Review Request] Some modifications in compare.cpp

I concentrated on slightly improving the Scroll Sync and Wrap management.
It works well, but the structure of the code is not very elegant. It was written as a proposed draft for UFO.
I'd highly appreciate it if you could review it.
(Compare the original compare.cpp and my modified file; I've added "// Yaron" to my changes and some (alas, too) short comments).

**
I wrote it about a year ago. If anyone takes it, I'll provide more info.

Compare Original and Modified.zip

[CLOSED] An option to close compared files if they match

Issue by Yaron10
Thursday Mar 10, 2016 at 19:05 GMT
Originally opened as pnedev/comparePlus#2


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.

v1.5.6.7: Occasional crashes and a proposed fix

STR:
Uncheck "Ignore Spacing" and compare the files in Test.zip.

Result:
The Plugin Manager throws an exception and Compare crashes.

Proposed fix:
Changing

#define VARRAY_INIT_SIZE 16

to

 #define VARRAY_INIT_SIZE 5

(in varray.h) seems to solve the problem.

Test.zip

[CLOSED] Fix Shortcuts and modify some Text Stings

Issue by Yaron10
Thursday Mar 10, 2016 at 19:06 GMT
Originally opened as pnedev/comparePlus#3


Replace

            funcItem[CMD_COMPARE_LAST_SAVE]._pFunc = compareLocal;
            lstrcpy(funcItem[CMD_COMPARE_LAST_SAVE]._itemName, TEXT("Compare to last save"));
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isCtrl = false;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_key = 'S';
            funcItem[CMD_COMPARE_LAST_SAVE]._init2Check = false;

            funcItem[CMD_COMPARE_SVN_BASE]._pFunc = compareSvnBase;
            lstrcpy(funcItem[CMD_COMPARE_SVN_BASE]._itemName, TEXT("Compare against SVN base"));
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isCtrl = false;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_key = 'B';
            funcItem[CMD_COMPARE_SVN_BASE]._init2Check = false;

            funcItem[CMD_COMPARE_GIT_BASE]._pFunc = compareGitBase;
            lstrcpy(funcItem[CMD_COMPARE_GIT_BASE]._itemName, TEXT("Compare against GIT base"));
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey = new ShortcutKey;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isAlt = true;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isCtrl = true;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isShift = false;
            funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_key = 'B';
            funcItem[CMD_COMPARE_GIT_BASE]._init2Check = false;

            funcItem[CMD_SEPARATOR_2]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_2]._itemName, TEXT("------------"));
            funcItem[CMD_SEPARATOR_2]._pShKey = NULL;

            funcItem[CMD_ALIGN_MATCHES]._pFunc = alignMatches;
            lstrcpy(funcItem[CMD_ALIGN_MATCHES]._itemName, TEXT("Align Matches"));
            funcItem[CMD_ALIGN_MATCHES]._pShKey = NULL;
            funcItem[CMD_ALIGN_MATCHES]._init2Check = false;

            funcItem[CMD_IGNORE_SPACING]._pFunc = includeSpacing;
            lstrcpy(funcItem[CMD_IGNORE_SPACING]._itemName, TEXT("Ignore Spacing"));
            funcItem[CMD_IGNORE_SPACING]._pShKey = NULL;
            funcItem[CMD_IGNORE_SPACING]._init2Check = false;

            funcItem[CMD_DETECT_MOVES]._pFunc = detectMoves;
            lstrcpy(funcItem[CMD_DETECT_MOVES]._itemName, TEXT("Detect Moves"));
            funcItem[CMD_DETECT_MOVES]._pShKey = NULL;
            funcItem[CMD_DETECT_MOVES]._init2Check = false;

            funcItem[CMD_USE_NAV_BAR]._pFunc = ViewNavigationBar;
            lstrcpy(funcItem[CMD_USE_NAV_BAR]._itemName, TEXT("Navigation bar"));
            funcItem[CMD_USE_NAV_BAR]._pShKey = NULL;
            funcItem[CMD_USE_NAV_BAR]._init2Check = false;

            funcItem[CMD_SEPARATOR_3]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_3]._itemName, TEXT("-----------"));
            funcItem[CMD_SEPARATOR_3]._pShKey = NULL;

            funcItem[CMD_PREV]._pFunc = Prev;
            lstrcpy(funcItem[CMD_PREV]._itemName, TEXT("Previous"));
            funcItem[CMD_PREV]._pShKey = new ShortcutKey;
            funcItem[CMD_PREV]._pShKey->_isAlt = false;
            funcItem[CMD_PREV]._pShKey->_isCtrl = true;
            funcItem[CMD_PREV]._pShKey->_isShift = false;
            funcItem[CMD_PREV]._pShKey->_key = VK_PRIOR;
            funcItem[CMD_PREV]._init2Check = false;

            funcItem[CMD_NEXT]._pFunc = Next;
            lstrcpy(funcItem[CMD_NEXT]._itemName, TEXT("Next"));
            funcItem[CMD_NEXT]._pShKey = new ShortcutKey;
            funcItem[CMD_NEXT]._pShKey->_isAlt = false;
            funcItem[CMD_NEXT]._pShKey->_isCtrl = true;
            funcItem[CMD_NEXT]._pShKey->_isShift = false;
            funcItem[CMD_NEXT]._pShKey->_key = VK_NEXT;
            funcItem[CMD_NEXT]._init2Check = false;

            funcItem[CMD_FIRST]._pFunc = First;
            lstrcpy(funcItem[CMD_FIRST]._itemName, TEXT("First"));
            funcItem[CMD_FIRST]._pShKey = new ShortcutKey;
            funcItem[CMD_FIRST]._pShKey->_isAlt = false;
            funcItem[CMD_FIRST]._pShKey->_isCtrl = true;
            funcItem[CMD_FIRST]._pShKey->_isShift = true;
            funcItem[CMD_FIRST]._pShKey->_key = VK_PRIOR;
            funcItem[CMD_FIRST]._init2Check = false;

            funcItem[CMD_LAST]._pFunc = Last;
            lstrcpy(funcItem[CMD_LAST]._itemName, TEXT("Last"));
            funcItem[CMD_LAST]._pShKey = new ShortcutKey;
            funcItem[CMD_LAST]._pShKey->_isAlt = false;
            funcItem[CMD_LAST]._pShKey->_isCtrl = true;
            funcItem[CMD_LAST]._pShKey->_isShift = true;
            funcItem[CMD_LAST]._pShKey->_key = VK_NEXT;
            funcItem[CMD_LAST]._init2Check = false;

            funcItem[CMD_SEPARATOR_4]._pFunc = NULL;
            lstrcpy(funcItem[CMD_SEPARATOR_4]._itemName, TEXT("-----------"));
            funcItem[CMD_SEPARATOR_4]._pShKey = NULL;

            funcItem[CMD_OPTION]._pFunc = openOptionDlg;
            lstrcpy(funcItem[CMD_OPTION]._itemName, TEXT("Option"));
            funcItem[CMD_OPTION]._pShKey = NULL;
            funcItem[CMD_OPTION]._init2Check = false;

with

        funcItem[CMD_COMPARE_LAST_SAVE]._pFunc = compareLocal;
        lstrcpy(funcItem[CMD_COMPARE_LAST_SAVE]._itemName, TEXT("Compare to last Save"));
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isCtrl = false;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_LAST_SAVE]._pShKey->_key = 'S';
        funcItem[CMD_COMPARE_LAST_SAVE]._init2Check = false;

        funcItem[CMD_COMPARE_SVN_BASE]._pFunc = compareSvnBase;
        lstrcpy(funcItem[CMD_COMPARE_SVN_BASE]._itemName, TEXT("Compare to SVN base"));
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isCtrl = false;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_SVN_BASE]._pShKey->_key = 'B';
        funcItem[CMD_COMPARE_SVN_BASE]._init2Check = false;

        funcItem[CMD_COMPARE_GIT_BASE]._pFunc = compareGitBase;
        lstrcpy(funcItem[CMD_COMPARE_GIT_BASE]._itemName, TEXT("Compare to GIT base"));
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey = new ShortcutKey;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isAlt = true;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isCtrl = true;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_isShift = false;
        funcItem[CMD_COMPARE_GIT_BASE]._pShKey->_key = 'G'; // Yaron
        funcItem[CMD_COMPARE_GIT_BASE]._init2Check = false;

        funcItem[CMD_SEPARATOR_2]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_2]._itemName, TEXT("------------"));
        funcItem[CMD_SEPARATOR_2]._pShKey = NULL;

        funcItem[CMD_ALIGN_MATCHES]._pFunc = alignMatches;
        lstrcpy(funcItem[CMD_ALIGN_MATCHES]._itemName, TEXT("Align Matches"));
        funcItem[CMD_ALIGN_MATCHES]._pShKey = NULL;
        funcItem[CMD_ALIGN_MATCHES]._init2Check = false;

        funcItem[CMD_IGNORE_SPACING]._pFunc = includeSpacing;
        lstrcpy(funcItem[CMD_IGNORE_SPACING]._itemName, TEXT("Ignore Spacing"));
        funcItem[CMD_IGNORE_SPACING]._pShKey = NULL;
        funcItem[CMD_IGNORE_SPACING]._init2Check = false;

        funcItem[CMD_DETECT_MOVES]._pFunc = detectMoves;
        lstrcpy(funcItem[CMD_DETECT_MOVES]._itemName, TEXT("Detect Moves"));
        funcItem[CMD_DETECT_MOVES]._pShKey = NULL;
        funcItem[CMD_DETECT_MOVES]._init2Check = false;

        funcItem[CMD_USE_NAV_BAR]._pFunc = ViewNavigationBar;
        lstrcpy(funcItem[CMD_USE_NAV_BAR]._itemName, TEXT("Navigation Bar"));
        funcItem[CMD_USE_NAV_BAR]._pShKey = NULL;
        funcItem[CMD_USE_NAV_BAR]._init2Check = false;

        funcItem[CMD_SEPARATOR_3]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_3]._itemName, TEXT("-----------"));
        funcItem[CMD_SEPARATOR_3]._pShKey = NULL;

        funcItem[CMD_PREV]._pFunc = Prev;
        lstrcpy(funcItem[CMD_PREV]._itemName, TEXT("Previous"));
        funcItem[CMD_PREV]._pShKey = new ShortcutKey;
        funcItem[CMD_PREV]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_PREV]._pShKey->_isCtrl = false;
        funcItem[CMD_PREV]._pShKey->_isShift = false;
        funcItem[CMD_PREV]._pShKey->_key = VK_PRIOR;
        funcItem[CMD_PREV]._init2Check = false;

        funcItem[CMD_NEXT]._pFunc = Next;
        lstrcpy(funcItem[CMD_NEXT]._itemName, TEXT("Next"));
        funcItem[CMD_NEXT]._pShKey = new ShortcutKey;
        funcItem[CMD_NEXT]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_NEXT]._pShKey->_isCtrl = false;
        funcItem[CMD_NEXT]._pShKey->_isShift = false;
        funcItem[CMD_NEXT]._pShKey->_key = VK_NEXT;
        funcItem[CMD_NEXT]._init2Check = false;

        funcItem[CMD_FIRST]._pFunc = First;
        lstrcpy(funcItem[CMD_FIRST]._itemName, TEXT("First"));
        funcItem[CMD_FIRST]._pShKey = new ShortcutKey;
        funcItem[CMD_FIRST]._pShKey->_isAlt = true; // Yaron
        funcItem[CMD_FIRST]._pShKey->_isCtrl = true;
        funcItem[CMD_FIRST]._pShKey->_isShift = false;
        funcItem[CMD_FIRST]._pShKey->_key = VK_PRIOR;
        funcItem[CMD_FIRST]._init2Check = false;

        funcItem[CMD_LAST]._pFunc = Last;
        lstrcpy(funcItem[CMD_LAST]._itemName, TEXT("Last"));
        funcItem[CMD_LAST]._pShKey = new ShortcutKey;
        funcItem[CMD_LAST]._pShKey->_isAlt = true;  // Yaron
        funcItem[CMD_LAST]._pShKey->_isCtrl = true;
        funcItem[CMD_LAST]._pShKey->_isShift = false;
        funcItem[CMD_LAST]._pShKey->_key = VK_NEXT;
        funcItem[CMD_LAST]._init2Check = false;

        funcItem[CMD_SEPARATOR_4]._pFunc = NULL;
        lstrcpy(funcItem[CMD_SEPARATOR_4]._itemName, TEXT("-----------"));
        funcItem[CMD_SEPARATOR_4]._pShKey = NULL;

        funcItem[CMD_OPTION]._pFunc = openOptionDlg;
        lstrcpy(funcItem[CMD_OPTION]._itemName, TEXT("Options"));   // Yaron
        funcItem[CMD_OPTION]._pShKey = NULL;
        funcItem[CMD_OPTION]._init2Check = false;

Thank you.

Assertion failed - vector subscript out of range

I'm using Notepad++ 6.9.2 on Windows 7 x64 with the latest CI build of the compare plugin, made from 2e55f81, see https://ci.appveyor.com/project/jsleroy/compare-plugin/build/job/28h8q8a1w5vg0w7n/artifacts.

Notepad++ I have split into 2 vertical panes. In the left pane file1.c and in the right pane file2.c. When I attempt to compare the two files (Plugins > Compare > Compare) Notepad++ will show an assertion failed error. This is 100% reproducible for me. Attached are the files:

Assertion failed - vector subscript out of range.zip

assertion failed - vector subscript out of range

Prior to this I used a CI build from 99e0c6c and occasionally it would give me the same error when working on random comparisons, however I don't think I ever had a repro case.

Also... is this the canonical repo for the compare plugin? (ie am I reporting this in the right place). I see the @pnedev fork has a master that seems to be more active.

[Enhancement] Can we get some documentation?

I realize that this is a super simple and mostly self-explanatory, but there is one thing that I cant find, regarding the symbolism (in the side column when doing a diff, the +- are obvious but what is the orange what looks like an equals sign with a line down the center of it?).

Maybe if someone was bored they could add single HTML page that describes the plugin, and put a link to it hosted somewhere in the about box in the plugin?

Flickering, black blocks, broken scrolling, lines misaligned

Hi, I am new here and only registered at github, because I like and use the compare plugin a lot and now getting some serious errors.

Unfortunately this plugin is unusable in its current state. I never had any problems with the previous versions and I liked to use it a lot for work and private purposes. Now it simply doesn't work anymore.

I can only scroll down, regardless of the mouse wheel direction. When I scoll it flickers heavily and both sides are not in sync. Additionally it shows black blocks and behaves randomly. Please see the attachment for an example. Thank you :)

npp compare bug

Notepadd++ v5.9.5
Compare v2.0

Compare current and previous files and place current in the top view

From @Yaron10 on March 10, 2016 19:5

When comparing In One-View mode, the current file and the previous file should be compared.
Also, the current file should always get the top (or left) view.

NOTE:
This fix (current at top) does not address "Compare to last Save".
I've never used "Compare to Git".


Replace

    if(!IsWindowVisible(nppData._scintillaMainHandle) || !IsWindowVisible(nppData._scintillaSecondHandle))
    {   
        skipAutoReset = true;
        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_GOTO_ANOTHER_VIEW, 0);
        skipAutoReset = false;
        panelsOpened = true;
    }

with

    if(!IsWindowVisible(nppData._scintillaMainHandle) || !IsWindowVisible(nppData._scintillaSecondHandle))  // Yaron - One-View mode.
    {
        skipAutoReset = true;

        // Yaron - In One-View mode, the current view can be 0 or 1.
        // In Two-Views mode, the top (or left) view is ALWAYS 0, and the bottom view is ALWAYS 1.
        int currentView = SendMessage(nppData._nppHandle, NPPM_GETCURRENTVIEW, 0, 0);
        LRESULT bufferID = SendMessage(nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0);

        // Yaron - If the current view is 0, we want the prev file to be moved to the bottom; if the current view is 1, we still need to activate it and make sure it's compared to the current file.
        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_TAB_PREV, 0);

        if(currentView == 1)
        {
            bufferID = SendMessage(nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0);
            SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_TAB_NEXT, 0);      // Yaron - Switch back to current file.
        }

        SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_GOTO_ANOTHER_VIEW, 0);     // Yaron - Current file is ALWAYS at top, and prev file is ALWAYS at bottom.

        activateBufferID(bufferID, currentView);        // Yaron - If the current view is 0, activate current file at top; if the current view is 1, activate prev file at bottom (possibly multiple files there).

        if (currentView == 1)
            SendMessage(nppData._nppHandle, WM_COMMAND, IDM_VIEW_SWITCHTO_OTHER_VIEW, 0);       // Yaron - Activate current file at top.

        skipAutoReset = false;
        panelsOpened = true;
    }

and add the following function

void activateBufferID(LRESULT bufferID, int view)
{
    LRESULT index = SendMessage(nppData._nppHandle, NPPM_GETPOSFROMBUFFERID, bufferID, view);
    index = index & 0x3FFFFFFF;

    SendMessage(nppData._nppHandle, NPPM_ACTIVATEDOC, view, index);
}

Thank you.

Copied from original issue: pnedev/comparePlus#1

Align compare tab when using multiline tab mode

Hello,
I have often a lot of tabs opened, so I enable the notepad++ option "Tab Bar / Multi-line" in the General preferences menu.
Since the tabs appears only on the left side, this create a shift between the left and the right side, making the diff harder to read. See the image bellow.

The right side should be shift as well as the left side to avoid this problematic.

pbtabbar_nppcompare

Black Screen when compare exceeds 16384 lines

Hello,

It is a great tool. But I am facing a problem with files containing more than 16384 lines (2^14). The screen gets black, I have to press Alt+F4 to close notepad++ to retrieve the desktop

Do you have a solution without splitting the file into many?

Best Regards,

[Suggestion] A new extra Status Bar for Compare

A new extra Status Bar for Compare could be useful.

It should have the following segments:

  1. Total diffs.

  2. No. of added lines.

  3. No. of removed lines.

  4. No. of not equal lines.

  5. No. of moved lines.

  6. Various messages: "No files to compare.", "Can not locate Git." etc.

  7. A small Progress Bar for comparing large files.
    Pressing "Clear Results" should terminate the process and close the status bar.

Anyway, the incomplete Progress Bar introduced in v.1.5.6.7 should be removed (unless, of course, its development is continued).

Future of Compare plugin

Currently there seem to be at least two branches of the Compare plugin

There are multiple issues though:

  • Both branches seem to have some (but likely not all) updates.
  • Conflicting version numbers (1.5.6.2 is the latest available from SourceForge by @jsleroy, 1.5.6.4 is the latest available from SourceForge by @ufo, 1.5.6.6 is available from Bitbucket by @ufo, this repository lists 1.5.7 which is not available anywhere in binary form though).
  • Notepad++ PluginManager does not now about any of those updated versions and provides users with an outdated version 1.5.6 that has some issues.

I think it would be great if both branches could be merged, including

  • One common code repository (e.g. this one or the one on Bitbucket by @ufo)
  • One "official" homepage (e.g. the current SourceForge project page at https://sourceforge.net/projects/npp-compare/ or simply the GitHub or the Bitbucket project page if you want to drop SourceForge as Notepad++ and many other projects did in the meantime)
  • Links that point to the "official" homepage of choice from inside the plugin and from all other project pages that might have existed at some time, so it is clear where the most recent information and the most recent code/binaries can be found.
  • Once the above is done one should also announce this on https://notepad-plus-plus.org/community/category/5/plugin-development and update the information for PluginManager, so people will get the latest version.

In this way I think popularity of the Compare plugin will greatly increase (right now it might seem to users that the plugin is unmaintained since the Bitbucket repository is not among the top hits of any search engine and the other repositories were not updated in a long time).
Also contributions can be channeled much more efficiently greatly benefiting the project.

Please let me know what you think of this suggestion. If you're willing to follow my suggestions I'd be happy to support you if you can use help with any of the steps.

Compare colorization is not cleared properly

  1. Open 3 files in N++
  2. Trigger 'compare'
  3. Go to the view with the two files. Let's call the file that is compared and colorized 'fileA'. Switch to the other file
  4. Clear compare results
  5. Switch again to 'fileA'. It is still colorized as if being compared.

BR,
Pavel

[CLOSED] Some minor code optimization

Issue by Yaron10
Thursday Mar 10, 2016 at 19:06 GMT
Originally opened as pnedev/comparePlus#5


Replace

    /* sync pannels */
    HMENU hMenu = ::GetMenu(nppData._nppHandle);

    syncScrollVwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLV, MF_BYCOMMAND) & MF_CHECKED) != 0;
    syncScrollHwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLH, MF_BYCOMMAND) & MF_CHECKED) != 0;
    if (syncScrollVwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);
    if (syncScrollHwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

    // let the second view inherit the zoom level of the main view
    int mainZoomLevel = SendMessage(nppData._scintillaMainHandle, SCI_GETZOOM, 0, 0);
    SendMessage(nppData._scintillaSecondHandle, SCI_SETZOOM, mainZoomLevel, 0);

    ::SendMessageA(nppData._scintillaMainHandle, SCI_GOTOPOS, 1, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_GOTOPOS, 1, 0);
    ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);
    ::SendMessageA(nppData._scintillaMainHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);

with

    // Yaron - Change code location.
    ::SendMessageA(nppData._scintillaMainHandle, SCI_GOTOPOS, 0, 0);    // Yaron - pos 0, 0. Why 1, 0?
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_GOTOPOS, 0, 0);
    //::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);       // Yaron - Not nedded.
    ::SendMessageA(nppData._scintillaMainHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);
    ::SendMessageA(nppData._scintillaSecondHandle, SCI_SETUNDOCOLLECTION, FALSE, 0);

    /* sync pannels */

    HMENU hMenu = ::GetMenu(nppData._nppHandle);

    syncScrollVwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLV, MF_BYCOMMAND) & MF_CHECKED) != 0;
    syncScrollHwasChecked = (::GetMenuState(hMenu, IDM_VIEW_SYNSCROLLH, MF_BYCOMMAND) & MF_CHECKED) != 0;

    if (syncScrollVwasChecked)      // Yaron - Disable vertical scroll sync. Use "case SCN_UPDATEUI:".
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLV, 0), 0);
    if (!syncScrollHwasChecked)     // Yaron - Enable horizontal scroll sync.
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

    // let the second view inherit the zoom level of the main view
    int mainZoomLevel = SendMessage(nppData._scintillaMainHandle, SCI_GETZOOM, 0, 0);
    SendMessage(nppData._scintillaSecondHandle, SCI_SETZOOM, mainZoomLevel, 0);

Why call

    if (syncScrollHwasChecked)
        ::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);

and then again
::SendMessage(nppData._nppHandle, WM_COMMAND, MAKELONG(IDM_VIEW_SYNSCROLLH, 0), 0);
? - Do it once.

NOTE: I've also changed SCI_GOTOPOS, 1, 0); to SCI_GOTOPOS, 0, 0);.
What do you think?

Thank you.

Navigation bar should not need to be scrolled

In the current development version of the compare plugin (I tested 129cfb9) the navigation bar was redesigned to be scrollable.

While this makes it a lot easier to locate the exact position of changes, it makes it impossible to quickly check (i.e. with one glance) where in the file changes were applied.

Personally I strongly prefer the previous behavior, where the navigation bar was only rescaled to fit the window height. This behavior should be brought back at least as an option.

Plugin not supported in notepad++

I'm getting the following error: "This plugin is not compatible with current version of notepad++." It might be result of changing from Notepad 6 to 7. What can I do to remedy this error? I have installed the dll in the correct plugin folder.

Notepad++ v7 64bit support

I've been using Notepad++ for an eternity and heavily relied on the Compare plugin for it to easily diff source code.
With the release of the Notepad++ version 7 in 64bit I naturally switched to that .. only to find out that the Compare plugin is not yet compatible.
Any chance to get a working 64bit binary build of the plugin soon-ish?

Implement short help

Issue by Yaron10
Friday Apr 08, 2016 at 06:38 GMT
Originally opened as pnedev/comparePlus#43


Hello Pavel,

Continued from pnedev/comparePlus#10 (comment).

If I understand "Select first" correctly, you want to give the user another option besides "Compare current to previous".
This can be very useful if you have multiple files open in Single-View mode. Great!

So why not implement it as "Compare current to last active" instead of "Select first" which is less intuitive and clear? (No offense please :) ).

Compare: Compare current to previous (Single-View) or Compare current to the active file in the other view.
Compare current to last active: should only be available in Single-View mode.

What do you think?

Anyway, I think you should add a Help item opening a window (a long message box) briefly describing the various options.

Thank you.

Best regards.

Compare and NPP Recent Files list

STR:

  1. Clear the Recent Files list.
  2. Open two files and compare them.

Result:
One file (while still open) is added to the Recent Files list.

A similar problem occurs in other cases as well.

[Proposal] Which files to compare?

Hi guys,

I have a proposal about making the files to be compared more explicit.

Example of the current situation:

  1. We have several files opened in N++
  2. We are viewing one of them in N++ view 1
  3. We are starting a compare action

At this point it is not quite clear for me as a user which files will get compared. The currently viewed one and the next? The previous?

So my suggestion is the following:

  1. We have several files opened in N++
  2. We are viewing one of them in N++ view 1
  3. We move the second file to be compared to N++ view 2
  4. We start compare and the currently active (viewed) files from N++ views 1 and 2 get compared

Does it make sense, what do you think?

BR,
Pavel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.