pnedev / comparePlus

Compare plugin for Notepad++
GNU General Public License v3.0
959 stars 139 forks source link

In Notepad++ v7.7 scroll synchronization does not work #201

Closed andrecool-68 closed 1 year ago

andrecool-68 commented 5 years ago

In the new version of Notepad++ v7.7 scroll synchronization does not work during file comparison (plugin ComparePlugin2.0)

Notepad++ v7.7 (64-bit) Build time : May 14 2019 - 01:26:08 Path : C:\Users\Uzeer\Desktop\npp.7.7.bin\x64\notepad++.exe Admin mode : ON Local Conf mode : ON OS : Windows 7 (64-bit) Plugins : ComparePlugin.dll DSpellCheck.dll HTMLTag.dll JSMinNPP.dll mimeTools.dll NppConverter.dll NppExport.dll NppMarkdownPanel.dll VisualStudioLineCopy.dll XMLTools.dll _CustomizeToolbar.dll

pnedev commented 5 years ago

@andrecool-68 ,

Strange, I couldn't reproduce the issue on Notepad 7.7 (32-bit under Wine) neither with Compare v2 nor with ComparePlus. I'll try again on native Windows and with 64-bit version. Thanks for the feedback :+1:

andrecool-68 commented 5 years ago

@pnedev 1

pnedev commented 5 years ago

@andrecool-68 , @rddim ,

I didn't test Compare v2 I consider it kind of "obsolete" now that I'm close to releasing ComparePlus.

But I did test with ComparePlus and the issue is present only on 64-bit Notepad++ 7.7. That's kind of normal considering the variable types and notifications changes in the new Scintilla.

I'll fix it some time soon, thanks again for letting me know about the problem :+1:

fkl79675 commented 5 years ago

I experienced the same issue. Thank you pnedev for working on a fix and an all new version.

(@andrecool-68 How did you create this gif?)

andrecool-68 commented 5 years ago

@fkl79675 https://github.com/NickeManarin/ScreenToGif

Stady234 commented 5 years ago

I closed my duplicate issue.. sorry. Interested in the new version!

pnedev commented 5 years ago

Thanks @Yaron10 :+1:

Pyre909 commented 5 years ago

Hi @pnedev,

I tested this in the commit Update to Notepad++ 7.7 API. It's working for me, I don't know what others are experiencing. I have only tested this only comparing with XML files.

Debug Info: Notepad++ v7.7 (64-bit) Build time : May 25 2019 - 19:46:35 Path : C:\Program Files\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : OFF OS : Windows 10 (64-bit) Plugins : ComparePlugin.dll LuaScript.dll mimeTools.dll NppConverter.dll

pnedev commented 5 years ago

Thanks for testing and sharing @Pyre909 . It should be working for everybody.

The issue is fixed for ComparePlugin v2, here are the x86 and x64 binaries.

pidgeon777 commented 5 years ago

Hello pnedev, just a question, does this new release include all of the fixes you mentioned during these last days? For example, undo history bug, live compare feature, etc.

Thanks again.

pnedev commented 5 years ago

Hello @pidgeon777 ,

No, it is the official Compare 2.0 but with changed Notepad++ API so the people who moved to Notepad++ 7.7 can have a working Compare.

The fixes you are talking about will be in the next official release which is going to be completely new plugin (it will be called ComparePlus). You can read more about that here.

BR

pidgeon777 commented 5 years ago

Cool, thank you!

dhanotra commented 4 years ago

Enable this while doing compare. View -> Synchronize Vertical Scrolling

pnedev commented 4 years ago

Don't do that.

If your Notepad++ version is 7.7 or higher use these Compare 2.0 versions:

x86: https://github.com/pnedev/compare-plugin/releases/download/v2.0.0_npp7.7/ComparePlugin_v2.0.0_npp7.7_x86.zip

x64: https://github.com/pnedev/compare-plugin/releases/download/v2.0.0_npp7.7/ComparePlugin_v2.0.0_npp7.7_X64.zip

broszkiet commented 4 years ago

Uninstall Compare plugin using Plugins Admin and install again.

ballios commented 4 years ago

I confirm that in Notepad++ v7.8.1 scroll synchronization does not work (for ComparePlugin v2.0.0 npp7.7 x64)! Please fix it to make it convenient to work!

pnedev commented 4 years ago

Does anyone else experience the same issue as @ballios ?

Stady234 commented 4 years ago

Mine works... image

pnedev commented 4 years ago

Thanks @Stady234 .

@ballios , Can you please double check it doesn't work on your side?

ballios commented 4 years ago

I confirm that in Notepad++ v7.8.1 scroll synchronization does not work. I need to switch on "Sync Verticle Scrolling" button manually...

pnedev commented 4 years ago

Ok, I'll check that

ballios commented 4 years ago

Moreover, your ComparePlugin v2.0.0 npp7.7 x64 (there is no such problem in default ComparePlugin v2.0.0) does not always work well when comparing long lines, for example code. The impossibility of scrolling with the mouse appears, and comparing the contents is somehow stuck.

pnedev commented 4 years ago

@ballios ,

I just checked with the portable Notepad++ 7.8.1 version. I used the Notepad++ Plugin's Admin to download Compare v2 and it is working fine. I didn't experienced any problems with the scroll sync.

Besides, the only difference between Compare v2 and Compare v2 for Npp 7.7 and above is the changes in the plugins API that comes from the Notepad++ 7.7 new plugins handling.

If you need further help you'll need to describe in details what you are doing and how - step by step starting from Notepad++ 7.8.1 installation then Compare v2 installation and so on.

dtwaling commented 4 years ago

Just want to confirm (in case anyone else checks this thread) --> when updating npp 7.x to version 7.8.1 or later, you can use Plugin Admin to remove the plugin, then open Plugin Admin to select and re-installing the Compare plugin again. This does resolve the issue described.

This is not totally unexpected given the API changes in npp. And, I did have to do this for a few other plugins as well after updating to npp v7.8.x

JohanPirlouit commented 4 years ago

Hello everyone,

As @dtwaling said, I can confirm that to recover the vertical scroll sync with NPP 7.8+, I had to reinstall Compare plugin using the Plugin Admin (remove and reinstall) and ... it works!

Thanx @dtwaling for the tip ;-)

pnedev commented 4 years ago

And one more thing:

If you continue to experience problems with vertical scroll sync while in compare and you have followed all the instructions above (to update the Compare v2 plugin) then remove all your other plugins because they might not have been updated to the new N++ 7.7 (and above) API and thus compromise Notepad++ normal work.

Leave only the updated Compare v2 for Npp7.7 plugin and retry.

Corendiel commented 4 years ago

I'm in version 7.8.4 of Notepad++ and 2.0.0 of compare plugin. I remove every other plugin and Compare is still not activating the vertical sync scrolling. image Even if I start in 2 views mode with vertical sync scrolling activated. Turning on Compare will turn off vertical sync scrolling and reactivate it after I stop Compare.

So you might be right Compare use its own vertical sync scrolling setting. The problem is that the option is not active by default and it doesn't save the setting for future use.

Stady234 commented 4 years ago

Has to be something else you have... I just installed and checked on 5 of my work machines that never had notepad++ on them... everything works as expected.

I would remove notepad++ and all plugins, then follow up with a "system maintenance" tool... i have had great luck with Glarysoft.com (and it is free)...

pnedev commented 4 years ago

@Corendiel ,

I need a little clarification:

When you say

I remove every other plugin and Compare is still not activating the vertical sync scrolling.

do you mean that the files are not scrolling vertically together while they are compared? Or you mean that the Notepad++ vertical scroll sync option is off?

So you might be right Compare use its own vertical sync scrolling setting.

Yes, I'm sure. I'm the developer of Compare plugin :)

The problem is that the option is not active by default and it doesn't save the setting for future use.

Again, what option is not active by default and saved for future use? Do you mean the Notepad++ vertical scroll sync option?


To summarize again: Compare plugin does not rely at all on Notepad++ vertical scroll sync setting. Compare plugin does the vertical sync on its own and it does it always. It cannot be turned off. In order not to interfere with Notepad++, Compare plugin temporarily switches off Notepad++ vertical sync while in compare. After the compare is closed the Notepad++ vertical sync is restored to its state before the compare.

BR

Corendiel commented 4 years ago

Thanks @pnedev, for looking into this. I like your plugin and that's why I'm taking the time to document the issue here.

For info, I have this issue on 2 different computers one at home and my work laptop. Both are on Windows 10. At work, it is Windows 10 Enterprise Version 1809 Build 17763.914. I can give you my home version later if needed. I'm writing from work right now. Notepad++ 64 version 7.8.4 and Compare Plugin 2.0.0 It might be a weird combination of upgrades that caused it but seeing the number of people reporting a problem might not be a rare occurrence and point out that this feature has some weaknesses.

I removed every other plugin from the plugin folder before doing the following test.

I open Notepad++ with 2 long enough text files in side by side mode. The Sync Vertical Scrolling is not active and not showing as such in the Toolbar. image

I enable it in the Toolbar and it starts to Sync Scroll Correctly image

I close Notepad++

I restart Notepad++ and it opens my last session with my 2 files side by side. The Sync Vertical Scroll is disabled again. Notepad++ didn't save the status of my option before closing. image

I start a Compare. The Sync Horizontal Scroll turns on in the Toolbar but not the Vertical Scroll and Sync Vertical Scrolling doesn't work. image I click the Sync Vertical Scroll in the Toolbar and it starts scrolling correctly. I can turn it on and off. image I stop the Compare by using the "Clear all Compares" option in the Plugin menu. Both Vertical and Horizontal Sync Scroll turn off. image

I turn on the Sync Vertical Sync in the Toolbar. It works again. image

I start another Compare. The Vertical scroll turns off, the Horizontal turns on. Vertical Sync doesn't work. image

I stop the Compare by using the "Clear all Compares" option in the Plugin menu. Vertical Sync turns back on and Horizontal Sync Scroll turns off. Notepad++ remembers the status of the sync options before the Compare operation. image

I reinstall Notepad++ after removing the Compare plugin manually. Reinstalled Compare using the Plugin Manager. It did change somewhat for the better but not completely as expected. Notepad++ is still not saving the Vertical Sync Scroll option when closing. When starting a Compare when the option is turned on make the Toolbar button change status. image image Only the Vertical though. The Vertical Sync is now working by default but I can no longer turn it on and off. It is just always active no matter the Tool Bar Button status. I don't know if it's the expected behavior or not. I can turn Horizontal sync on and off but not Vertical sync.

I can live with this new behavior hopping it is not gonna change again. The sync is now always active in Compare mode and that is the main reason for me to use it in the first place.

Let me know if you have any more questions or if you need anything else.

Stady234 commented 4 years ago

Looks like you are using the wrong buttons completely... as in you have no idea how to use the plugin.

open two files you want to compare... don't change any options AT ALL.. don't click anything BUT the compare button on the toolbar.... Not the vertical sync, not the horizontal sync... NOTHING....

Then show what happens.... I use the compare tool almost daily when looking for differences in 3dprinter config files... i can make a few changes, and reclick the same button, and it will resync the compare process and update the list... No other issues....

pnedev commented 4 years ago

Thanks for trying to help @Stady234 .

Hi @Corendiel ,

Thank you for the detailed explanation. I really don't know what else to add to the summary in my previous post.

Notepad++ and Compare use different vertical scroll approaches internally. That's why Compare turns off Notepad++ vertical scroll while compare is active and restores the previous Notepad++ state (the one before the compare was started) when compare is over. While in compare you cannot turn off vertical scroll - it is always active. You shouldn't try using Notepad++ vertical scroll while in compare. Compare plugin v2 has always behaved that way - it never changed.

The reason why you didn't have vertical scroll before you updated Compare plugin is because there are two Compare v2 variants - one is for Notepad++ versions < 7.7 and one is for Notepad++ versions >= 7.7. You can have a look here: https://github.com/pnedev/compare-plugin/releases/tag/v2.0.0 (for Notepad++ < 7.7) https://github.com/pnedev/compare-plugin/releases/tag/v2.0.0_npp7.7 (for Notepad++ >= 7.7).

So what happened was that you upgraded Notepad++ from version < 7.7 to version 7.8.4 (> 7.7) but the Compare plugin was not updated and it doesn't work normally because it is not for the new Notepad++ version. That's why after you reinstalled Compare the proper plugin version was installed (for your new Notepad++) and everything works as expected (you always have vertical scroll while in compare, no matter the Notepad++ vertical scroll setting).


As a side note: Notepad++ vertical scroll not being preserved when Notepad++ restarts is Notepad++'s issue and has nothing to do with Compare plugin.

Corendiel commented 4 years ago

@Stady234 I have been using this plugin for 10 years I know how to use it thank you. It's not because you use it a certain way that it's not intended to work in another expected way. Buttons are meant to be clicked. Again I'm, not the only person reporting this issue. There are other threads out there for this https://github.com/notepad-plus-plus/notepad-plus-plus/issues/5250 https://sourceforge.net/p/npp-compare/bugs/38/

@pnedev, Thanks for the versioning explanation. I believe this is the true answer. Looking back at the history you gave that explanation on Jul 26, 2019. It is confusing though that the Compare plugin didn't change in version number. I don't know if it's complex for you to increase the version like 2.0.1. It might force more people to upgrade to the right version. I ended in this exact messed up config on 2 very different PCs not updated at the same time. Looking at some comment after Jul 26 other people didn't see the _npp7.7 in the version. I believe the issue is fixed Uninstalling the Compare plugin using Plugins Admin and installing it again should do the trick. People should not trust the version number and reinstall anyway.

I never really tinkered with the vertical scrolling before until it started not beeing active by default. So I believe you if you say it has always been like that. However, now that I tested thoroughly I still believe the comportment of the toolbar buttons is confusing.

Looks like you are working on a ComparePlus plugin so you might have a different approach. If you need an annoying perfectionist tester let me know.

pnedev commented 4 years ago

@Corendiel ,

Thanks for the suggestions and I'm glad we found the root cause. :+1:

One remark: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/5250 is a thread for Notepad++ vertical scroll setting not being remembered correctly not for the Compare plugin. So it is a completely different issue.

And now some clarifications:

I don't know if it's complex for you to increase the version like 2.0.1.

It is not complex at all of course. But it is the same Compare plugin version (v2), nothing changed in its functionality. It is the Notepad++ that actually changed its plugins API since v7.7 making almost all current plugins obsolete. The change was for good of course but Notepad++ and the plugins out there are developed by different people and the synchronization when such things happen is kind of lacking. The normal thing in this case would be when Notepad++ triggers its automatic update to notify the user that his/hers plugins are no longer safe to use. The normal thing to report as an issue in this case would be to say "After updating Notepad++ to version X, Compare vertical scroll is no longer working". It was working before, right, so what changed? I didn't want to change the version number because it would be confusing as well. If we look at it the other way around, you are still at Notepad++ version 7.5 and you see that there is a new Compare plugin version 2.0.1. You then might want the latest version and if you update only the Compare plugin you'll get to a similar situation because 2.0.1 would not be compatible with N++ 7.5. I don't know which of the two is the better approach but here we are.

First, Horizontal and Vertical do not behave the same way. Horizontal turn On while Vertical turns Off.

They are not meant to behave the same way. Besides, Compare relies on Horizontal scrolling for user convenience - it doesn't need special handling for horizontal scrolling.

Second, even if Compare uses its own sync it does change the status of the Notpad++ Sync buttons. Making any average user think they are linked somehow. Maybe they should be greyed out in compare mode.

There is no other way for Compare to switch off Notepad++ vertical sync - the buttons state will change inevitably. I agree this might be confusing. ComparePlus tries to disable the Notepad++ scroll buttons to block user interaction.

Finally, why is the sync always On in Compare? and why not use Notepad++ Sync?

I will answer you by quoting you:

It's not because you use it a certain way that it's not intended to work in another expected way.

If the left and right document panes are not of equal horizontal size and you have WordWrap turned on, Notepad++ vertical scroll sync will not work properly to align compared lines. The user might as well disable vertical scroll, scroll one of the documents and then re-enable the vertical scroll. Then the scroll sync will be at different lines of the documents that will break compare diffs alignment.

Looks like you are working on a ComparePlus plugin so you might have a different approach. If you need an annoying perfectionist tester let me know.

I'll have that in mind, thank you :+1:

Corendiel commented 4 years ago

One remark: notepad-plus-plus/notepad-plus-plus#5250 is a thread for Notepad++ vertical scroll setting not being remembered correctly not for the Compare plugin. So it is a completely different issue.

I know it's a different issue but other people on that thread were bringing Compare behavior change too. Like me, most people were not using these buttons and sync scroll features until it stopped being active by default in Compare. My point was I'm not an isolated case and other people are in this mixed match version situation.

If we look at it the other way around, you are still at Notepad++ version 7.5 and you see that there is a new Compare plugin version 2.0.1. You then might want the latest version and if you update only the Compare plugin you'll get to a similar situation because 2.0.1 would not be compatible with N++ 7.5.

I would expect Plugins Admin to help you pick the right version of the plugin for the right version of your Notepad++. I have no idea how all the versioning works and which team does what but it's probably something the Plugins Admin team should look into.

If the left and right document panes are not of equal horizontal size and you have WordWrap turned on, Notepad++ vertical scroll sync will not work properly to align compared lines. The user might as well disable vertical scroll, scroll one of the documents and then re-enable the vertical scroll. Then the scroll sync will be at different lines of the documents that will break compare diffs alignment.

Ok I understand now. I tested too on my messed up setup and it can quickly get crazy. So I guess the best approach would be to have these buttons greyed out or always ON no matter if you click on them so the user knows it's meant to be always on when using compare. Making sure the user gets the proper feedback to reduce confusion.

I don't know which of the two is the better approach but here we are.

Personally I think people in the most recent version should have the best experience and the least amount of Bugs. Else, in time you discourage people to upgrade. If the guy is in 7.5 and 2.0.1 and has issues, it's unfortunate but he should be as much thorough in updating his Notepad++ as he is with his plugins. If you have issues, it's somewhat expected of you to update. In the current situation, it is not intuitive for people in the most recent version to remove and reinstall when they think they are as up to date as possible.

pnedev commented 4 years ago

My point was I'm not an isolated case and other people are in this mixed match version situation.

Yes, of course. All the people upgrading their Notepad++ from version < 7.7 to later versions have had the same problem with Compare and needed to reinstall it. It is confusing no doubt. That's why this issue was opened and visited by so many people.

I would expect Plugins Admin to help you pick the right version of the plugin for the right version of your Notepad++. I have no idea how all the versioning works and which team does what but it's probably something the Plugins Admin team should look into.

Plugin Admin picks the right version when you install a plugin anew. It does nothing with already installed plugins. I'm not sure there is a Plugin Admin team. Some people voluntarily help to maintain the plugin list updated with the latest versions of the available plugins for each Notepad++ release. I don't know more.

So I guess the best approach would be to have these buttons greyed out or always ON no matter if you click on them so the user knows it's meant to be always on when using compare.

Unfortunately they cannot be ON while in compare because if Notepad++ vertical scroll sync button is ON the sync will be active and it will mess things up. I don't work anymore on Compare plugin, I'm close to releasing the new ComparePlus and it disables those buttons while in compare.

In the current situation, it is not intuitive for people in the most recent version to remove and reinstall when they think they are as up to date as possible.

I agree but as I said earlier, currently there is no such synchronization between Notepad++ and the plugins versioning. A lot of the plugins are actually not maintained anymore. If I hadn't updated Compare it would have simply stopped working after Notepad++ 7.7 but you would continue having it installed (as is the case now). I got your point, I will consider releasing Compare 2 for N++ >= 7.7 with newer version number.

penguinairlines commented 4 years ago

I had this problem, found this github issue first google result, uninstall and reinstall the plugin making sure to launch NPP as admin, and vertical scroll works. I did not have to enable any other vertical scroll behavior for NPP. In fact, my only non-default setting of NPP is the cloud directory for portable installation and backup purposes.

Wayfarer-es commented 3 years ago

I just confirm what @broszkiet, @Corendiel, and @penguinairlines have already said: I had the same issue and it has been solved by just uninstalling the Compare plugin using Plugins Admin and then installing it again.

Using Notepad++ 7.9 64-bit with Compare Plugin v2.0.1 on Windows 10 Pro 64-bit 1919 Build 18363.1082