mariusv-github / ElasticTabstops

GNU General Public License v2.0
27 stars 3 forks source link

Warning message before closing notepad++ #2

Open Friedi opened 1 year ago

Friedi commented 1 year ago

After installing the new version 1.5 I get a warning message box for each unsaved file open in notepad when I try to close notepad++ "Closing file wasn't registed" (the spelling error is in the message box)

Notepad++: x64 8.4.7 ElasticTabstops: x64 1.5.0

The issue is:

  1. The warning does not state the cause and origin of the message box (ElasticTabstops Plugin.) And it is not clear why it appears nor what to do to avoid a warning. I found also no option to disable it at all.
  2. This warning should be off by default since it does not provide any help. I assume the plugin tries to save a tabstop setting and does not know the unsaved filename (though notepad saves such files in the backup folder). Anyway, if there is an unsaved file and notepad is about to close it is obviously that the file and tabstop setting is not important, Imho it is not the task of the plugin to point out that there are unsaved files.
fjcbs commented 1 year ago

Same with me. Notepad++: x64 8.4.8 ElasticTabstops: x64 1.5.0

I keep many temporary files open as small notes for diferent subjects => Control+N to create new file and paste the note or clipboard, so my notepad++ has "new 1", "new 2"... "new n" open and on close it saves as backup... I don't bother to save them.

After "ElasticTabstops: 1.5.0", on close, I get the "Closing file wasn't registed" warning for each unsaved file... very annoying and time consuming. So I had to remove this plugin.

tolot27 commented 1 year ago

@mariusv-github Please can you have a look into this issue? I've referenced the issue listed at the NPP repository.

r6d2 commented 1 year ago

Same issue here with NPP 8.4.8 and ET 1.5.0. But I get this warning with each file even if there's no need to save it since it has not changed.

The message comes from this line of code in function OnFileClosed():

if(idx==-1) { ::MessageBox(nppData._nppHandle, _T("Closing file wasn't registed"), _T("Warning"), MB_OK|MB_ICONWARNING); return; }

donho commented 1 year ago

Is anyone in here has the issue of losing unsaved data?

shawnkhall commented 1 year ago

Is anyone in here has the issue of losing unsaved data?

Negative. Even with dozens of files open, as long as I click "OK" in each of the error messages it closes and reopens each of my files in the same state, including bookmarks and document order.

donho commented 1 year ago

@shawnkhall Thank you for your reply!

bogdanv-ntnu commented 1 year ago

It happened in my case. I recently lost all my files after upgrading npp to 8.4.8 and when relaunched it was blank and had to close and then the messages started to popup and lost all files. It took me a while to figure out it was this plugin messing up.

echoix commented 1 year ago

I had the same thing with plugin version 1.5.0 and notepad++ version 8.4.9. Had to hold escape key until all dialog boxes are closed. Uninstalling the plugin fixed the behaviour.

FaceCrap commented 1 year ago

Sheesh, almost four months later and still no fix? Think I'll go try out the original

QGtKMlLz commented 1 year ago

Same here, error on closing with files open

rdipardo commented 1 year ago

Think I'll go try out the original

You could also try this new plugin, which has Elastic tabstops built in.

BelowZeroLH commented 1 year ago

There is a fix if you do it yourself. Download the source code, unzip it, and then do the following:

  1. Go into the src folder and find the file ElasticTabstops.vcxproj. Open it in Notepad++ or Notepad.
  2. Search out all instances of G:\Downloads\Notepad++\plugins\ElasticTabstops (there should be three) and replace them with $(SolutionDir)bin\$(Configuration)_$(Platform)\
  3. Save the file and exit.
  4. Open the SLN file ElasticTabstops.sln from the master folder (the one that contains the folder "src"). Use at least Visual Studio 2017. I used Visual Studio 2019 just fine while saying yes to the two upgrades to the solution.
  5. Find Source Files\ElasticTabstops.h ("src\ElasticTabstops.h") in the Visual Studio IDE in the Solution Explorer on the right side and open it (double-click it).
  6. Duplicate line 327: if(idx==-1) { ::MessageBox(nppData._nppHandle, _T("Closing file wasn't registed"), _T("Warning"), MB_OK|MB_ICONWARNING); return; } by pressing Ctrl+D on your keyboard.
  7. Comment the original line 327 with two forward slashes // at the beginning of the line.
  8. On line 328 (the duplicate) remove/delete the following from the line: ::MessageBox(nppData._nppHandle, _T("Closing file wasn't registed"), _T("Warning"), MB_OK|MB_ICONWARNING);
  9. Line 328 should now be just: if(idx==-1) { return; }
  10. In the toolbar you probably see Debug to the left of Win32. Change Debug to Release and if you are using a 64-bit version of Windows, change Win32 to x64. If you're not sure and are using Windows 7 or higher, change it to x64.
  11. Click Build in the menu and then Build Solution
  12. You may close the IDE if it says "Build succeeded" in the bottom left corner of the IDE. (If it says "Build failed", it's probably because you didn't perform steps 1 through 3. Exit the IDE and do those steps.)
  13. You now have a "bin" folder in the same place as your "src" folder. Inside the "bin" folder you'll find a "Release..." folder with your chosen flavor. Inside that folder you'll find your compiled DLL file.
  14. Open Notepad++
  15. Click "Plugins" in the menu and then "Open Plugins Folder..."
  16. Close Notepad++ once the folder opens (leave the folder open).
  17. Double-click "ElasticTabstops" in the plugins folder window.
  18. Copy your newly compiled DLL file into the ElasticTabstops plugin folder. Click "Continue" for Administrator permission (assuming you have the user rights to do so).
  19. ENJOY!

Sometimes the best solutions are the ones the ones you fix yourself...

besariong commented 1 year ago

@BelowZeroLH Thanks, that helped!

r6d2 commented 1 year ago

Just in case it's of use to anyone, there's this plugin which does the job as well.

bogdanv-ntnu commented 1 year ago

As soon as this is not detected as a trojan I will give it a chance :) image

wonkawilly commented 1 year ago

I get the same message too "Closing file wasn't registed" when I try to close notepad++ Also Elastic tab stops is really really slow. I hope the next release will have the code optimized to make it much more faster. because as it now is really frustrating to use

de-served commented 1 year ago

Same boat

BespokeBusinessSoftware commented 9 months ago

Still an issue in 2024.

hohwille commented 9 months ago

Same here - I just uninstalled ElasticTabstops and the problem is gone.

celegormz commented 8 months ago

There is a fix if you do it yourself. Download the source code, unzip it, and then do the following:

  1. Go into the src folder and find the file ElasticTabstops.vcxproj. Open it in Notepad++ or Notepad.
  2. Search out all instances of G:\Downloads\Notepad++\plugins\ElasticTabstops (there should be three) and replace them with $(SolutionDir)bin\$(Configuration)_$(Platform)\
  3. Save the file and exit.
  4. Open the SLN file ElasticTabstops.sln from the master folder (the one that contains the folder "src"). Use at least Visual Studio 2017. I used Visual Studio 2019 just fine while saying yes to the two upgrades to the solution.
  5. Find Source Files\ElasticTabstops.h ("src\ElasticTabstops.h") in the Visual Studio IDE in the Solution Explorer on the right side and open it (double-click it).
  6. Duplicate line 327: if(idx==-1) { ::MessageBox(nppData._nppHandle, _T("Closing file wasn't registed"), _T("Warning"), MB_OK|MB_ICONWARNING); return; } by pressing Ctrl+D on your keyboard.
  7. Comment the original line 327 with two forward slashes // at the beginning of the line.
  8. On line 328 (the duplicate) remove/delete the following from the line: ::MessageBox(nppData._nppHandle, _T("Closing file wasn't registed"), _T("Warning"), MB_OK|MB_ICONWARNING);
  9. Line 328 should now be just: if(idx==-1) { return; }
  10. In the toolbar you probably see Debug to the left of Win32. Change Debug to Release and if you are using a 64-bit version of Windows, change Win32 to x64. If you're not sure and are using Windows 7 or higher, change it to x64.
  11. Click Build in the menu and then Build Solution
  12. You may close the IDE if it says "Build succeeded" in the bottom left corner of the IDE. (If it says "Build failed", it's probably because you didn't perform steps 1 through 3. Exit the IDE and do those steps.)
  13. You now have a "bin" folder in the same place as your "src" folder. Inside the "bin" folder you'll find a "Release..." folder with your chosen flavor. Inside that folder you'll find your compiled DLL file.
  14. Open Notepad++
  15. Click "Plugins" in the menu and then "Open Plugins Folder..."
  16. Close Notepad++ once the folder opens (leave the folder open).
  17. Double-click "ElasticTabstops" in the plugins folder window.
  18. Copy your newly compiled DLL file into the ElasticTabstops plugin folder. Click "Continue" for Administrator permission (assuming you have the user rights to do so).
  19. ENJOY!

Sometimes the best solutions are the ones the ones you fix yourself...

it works :) thanks !

dleach02 commented 3 months ago

Why is this issue just not fixed in the distribution? The only fix listed is to download source, patch, build... sigh.