Notepad++ v8.4.7 Release
-
@Nino-kun
Hi, this is not regression but feature.If this new safer behavior bothers you, simply click on the “Restart anyway” in the blue Windows restart screen and you will get the same as before (“…close and on next start all files opened again.”).
But if you have some important unsaved stuff in N++, I recommend to change the habit and save files before initiating the OS restart/shutdown.
-
@xomx
I’ve just observed 2 different behaviours, here’s the scenario to reproduce the 1st behaviour:- open only 1 existing file in Notepad++
- add some text in the opened file without save it
- restart windows, “This program preventing restart” dialog appear, click on Cancel - the opened unsaved file is saved now.
Whereas if user clicks on Restart anyway, relaunch Notepad++ after Windows restarting, the file in question is still unsaved (the 2nd behaviour).
I would add a message box “Windows is forcing restarting. Do you want to save unsaved file” before the save all line:
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/NppBigSwitch.cpp#L2131
And this line will be executed only when user replies Yes.What do you think?
-
I can confirm this inconsistency, good catch!
Reason - I overlooked this line:
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/6803b69c0b92057d2ac5700b7a312a6cf2f82b39/PowerEditor/src/NppIO.cpp#L1669So if I have 2 or more dirty files, it works as I intended - showing this dlg to the user:
But for just one dirty file it directly saves without asking.
Now about the solution.
If we do what you proposed, there will be short (~5s I think) hang before the blue Windows restart screen with the “Restart anyway” & “Cancel” appears. That will be because of we did not immediately return TRUE/FALSE in the WM_QUERYENDSESSION as we should (Windows then thinks that the app hangs and arranges things according to that).
So I’d rather adjust the problematic line in the Notepad_plus::fileSaveAll() to something like:
if (nbDirty == 1 && curBuf->isDirty() && !nppParam.isEndSessionStarted())
-
@xomx said in Notepad++ v8.4.7 Release:
So I’d rather adjust the problematic line in the Notepad_plus::fileSaveAll() to something like:
There’s no reason for me to modify
bool Notepad_plus::fileSaveAll()
, because since this function is used everywhere, it could bring another regression.
Let’s focus on where there’s the problem to prevent from the regression. -
I don’t get it, how this feature work. Program doesn’t try to save all modified files on manual exit.
It would be logical to behave identical on normal/manual exit and OS restart, but now N++ doesn’t do that. -
@donho said in Notepad++ v8.4.7 Release:
There’s no reason for me to modify bool Notepad_plus::fileSaveAll(), because since this function is used everywhere, it could bring another regression.
What my proposal would do is to return the status before this speed optimization (1st in v8.4.3):
“Skip save all warning dialog if only current editing file is dirty. (Fix #10995)”
But only in case that Windows is being terminated.
It is simple patch and it reuses already existing N++ code, but if you do not like it, we can create a new N++ message (e.g. IDM_FILE_SAVEALL_AT_SHUTDOWN), where we show your message to the users and so on…
Should I create an issue for this where we can continue in discussion about solution?
-
@Nino-kun said in Notepad++ v8.4.7 Release:
It would be logical to behave identical on normal/manual exit and OS restart, but now N++ doesn’t do that.
Simply saying - you are right.
I took the opportunity to alert the users that they do not have data (standardly) saved. So if there is a non-critical OS restart/shutdown users are now notified about this fact and by selecting “Cancel” on the restart screen, they can handle this. Otherwise by clicking on the “Restart anyway” they are relying on the N++ backup engine as before.
@donho
What do you think - should we also fix this “inconsistency” in between the normal N++ exit and N++ exit forced by OS restart/shutdown?(possible solution is easy - just adding one more check for the active isSnapshotMode…)
-
@xomx said in Notepad++ v8.4.7 Release:
Should I create an issue for this where we can continue in discussion about solution?
Yes, please.
-
-
FYI: Auto-update for Notepad++ v8.4.7 has been triggered.
-
-
-
@donho ,
Unfortunately, @Craig-O-Neil has just reported a v8.4.7 regression in “New document | Default langauge not working for new NP++ instance”. I confirmed it and created the issue #12586.
-
I have a small (bag)
Please add Notepad++ on windows 11 context menu !
-
@Professor-Andrey said in Notepad++ v8.4.7 Release:
I have a small (bag)
Please add Notepad++ on windows 11 context menu !
Windows 11 has intentionally hidden that away, to steer users into a single Open With application. You can see the old-style menu by using Show More Options in the Right-click menu, or using Shift+F10 instead of Right clicking.
…
Or see the user manual section on the right -click for Windows 11 on this page: https://npp-user-manual.org/docs/other-resources/ -
Notepad++ v8.4.7 (64-bit)
Build time : Nov 1 2022 - 23:31:11
Path : C:_ProgramF\Notepad++_portable\npp.8.4.7.portable.x64\notepad++.exe
Command Line :
Admin mode : ON
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 7 Ultimate (64-bit)
OS Build : 7601.24511
Current ANSI codepage : 1251
Plugins :
Explorer (1.9.5)
mimeTools (2.9)
NppConverter (4.5)
NppExport (0.4) -
Yes, “enable smooth font” slightly changes how the font appears. this isn’t specific to v8.4.7, and is rather the point of the option.
-
v8.4.7 this happens / worked in 8.4.6
trying to open/edit multiple files …didn’t find any solution for it, however a lot of old reports showing the same errors -
@Mike7O ,
Windows ShellExecute is limited in the number of characters it will accept; this was true in v8.4.6 and is still true in v8.4.7, because it’s part of the Microsoft Windows win32-api definition for maximum command length.
You might consider not opening so many files from the same right-click from Explorer; then you can select the second half, and unless you have done something like telling Notepad++ to always open files in multisession, it will add the files to the existing Notepad++ window. Or just open the folder as a workspace from inside Notepad++.
-
@PeterJones nice, haven’t explored that many features so anything that makes my work easier is appreciated 🤩
-
@Mike7O
still I was able to do it in previous versions … well now I know alternative ways …
googled and this was the solutionso run as admin which some settings-changes required I will only do when I need 😎
-
Some times I find that the source is badly managed by notepad++.
As now I know that this can happen, when I find that the program has an inadequate behavior I delete the line and I retype it.
Example in the attached file, tittle should be in blue like the other keywords. I had to delete the line and reenter it.
This problem is unfortunately not reproducible.