-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make session missing files remembered #14202
Conversation
Fix issue #12079 If a file was not backed up when a session closed, previously when the session was reloaded, those files would simply disappear and the user could not choose to keep them Now an empty placeholder buffer will be created for any files without backup with a filename that doesn't exist. This placeholder can be reloaded from hard drive if the file it corresponds to is recreated, and its placeholder status will persist as long as it stays empty. The handling of backed-up files that don't exist will remain the same.
…b.com/molsonkiko/notepad-plus-plus into molsonkiko-fix_session_missing_files_remembering
…ture" This reverts commit 01d958b.
@Yaron10 You can always create an issue of feature request for YesAll/NoAll dialog, so someone more competent than I could implement this feature. Thank you for your understanding and for your participation of this issue. |
Thank you for your hard work. One last clarification:
STR: Result: This a major bug IMO. Possibly even worse than the current (master) behavior. *** And one last question:
Ideally: open NPP, display the tab-bar (and tabs), prompt and run the place-holders mechanism from there. A short code-snippet which can be added to the end of if (!allSessionFilesLoaded)
{
if (sessionFileName == nullptr) // session.xml.
{
_nativeLangSpeaker.messageBox("AutoSessionFilesError",
_pPublicInterface->getHSelf(),
L"Notepad++ can not open some file(s) from your last Session.\n\nThe Session file \"session.xml\" will be modified on exit!\nYou can backup that file NOW.",
L"Opening Session Files Error",
MB_OK | MB_ICONWARNING);
}
else // Manually-created session file (File -> Save Session).
{
_nativeLangSpeaker.messageBox("UserSessionFilesError",
_pPublicInterface->getHSelf(),
L"Notepad++ can not open some file(s) included in the following Session file:\n\n\"$STR_REPLACE$\"",
L"Opening Session Files Error",
MB_OK | MB_ICONWARNING,
0,
sessionFileName);
}
} Anyway, the place-holders can be as useful in user-sessions as they are in session.xml. |
It's not a bug for me. Users have the choice to not enable this feature, but if they enable it, they know what they are doing.
Though I don't consider it (opening all place-holders if this option is enabled) as a bug, I prefer still that users can choose to open them or not when the option is enabled. So I did the last try last night, and it works quite good. The final solution as you suggested has been committed into this PR. For unknown reason, the CI doesn't work, you can check the PR and compile it locally if you want.
All the work done in v8.5.8 for user created session is just for distinguishing user-session from session.xml. As a result they won't have the same behaviour. In the latest commit of the PR, the place-holder feature has been removed. |
Great! 👍
Could you please explain to me why the place-holders shouldn't work for user-sessions as well? https://ci.appveyor.com/project/donho/notepad-plus-plus/builds/48319984 |
Nice to learn about that :)
The logic is simple and it came from you: user-session should not be modified by Notepad++ for users.
Both brhaviours are not consist for users, so that's the reason to not have place-holders in user-session. |
Thank you for the explanation.
This is valid for user-sessions as well, isn't it?
Why? I think it's quite consistent. Yes, you'd need to use two different messages (one for session.xml and another for user-sessions), but isn't it worth it? I haven't "learned" the code. Still, allow me to ask: |
static bool theWarningHasBeenGiven = false; | ||
if (!theWarningHasBeenGiven) | ||
{ | ||
int res = (nppParamInst.getNativeLangSpeaker())->messageBox( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually tested it.
If res == IDNO - is there a reason to continue here and keep calling this function in loadSession()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well caught!
Fixed here: ccf6f75
Thank you, @donho & @molsonkiko. Do you think that implementing place-holders for user-sessions might be confusing? |
It would actually make it much worse compared to current master. |
Add translation texts for these commits: * Fix data loss issue due to no room on disk for saving (e30ee85) * Fix Wrong Categories in Shortcuts Mapper (39001d7) * Make auto-checking of Find InSelection configurable (OFF or resizable) (591b00e) * Dark mode tweaks and unicode size support for InSelection configurable size (b3179b5) Close #14147
Added translation for "Fix data loss issue due to no room on disk for saving" Close #14141
Close 14140
New revision and update Close #14116
New revision and update Close #14115
Done in the latest commit. |
Thank you for the recent changes and fixes. I'm not sure which commit should be tested.
Do you mean closing this PR and opening a new one? |
From #14168
Note that an option to activated this feature (remember all session files) has not been added yet.Fix #12079, fix #12744, fix #13696