-
-
Notifications
You must be signed in to change notification settings - Fork 548
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
Restore opened files between application restarts #264
Conversation
Calling this from outside the class does not give the proper results. The currently focused editor in the DockManger gets out of sync with the rest of the GUI
- Renamed settings - Move logic out of EditorManager that always required it to handle every possible use case - Added temporary flag to ScintillaNext so that it can show as unsaved even when it is unedited (e.g. modify() == true) - Properly handle when it is unsaved - Overhaul SessionManager logic - SessionManager determines if a file needs saved before closing
Renaming and add better preferences (kind of)
658e735
to
27e3c87
Compare
Very nice, will be my daily driver - thanks for your efforts. One situation ("bug"):
Basically: As long as a "New X" tab hasn't been saved, the next increment of new still is "New X", so no increment :) kind regards |
@mikelupe Thanks for testing it out!
Just to make sure, in step 2 wouldn't it be "New 2" since the "New 1" document was already saved? But yes this is one of the bugs, that you can't have two files with the same name currently. A couple points to this:
|
It is again "New 1", as the old "New 1" previously had been saved as "test.txt" in step 1 Thanks again for your effort, this will be epic :) |
This allows files with the same name to be stored in the session without overwriting one another.
I checked your latest commit: I had to remove the rm ~/.config/NotepadNext/NotepadNext.ini , otherwise I got a segfault :) Unfortunately now it generates a "New 2" but then later on again another "New 2". Almost there |
Yeah that makes sense, but would indicate some better error handling is needed incase the settings file gets modified or corrupted.
Yep the root issue was fixed so that even if you have two Just curious since you are on a non-Windows machine, where exactly does it save the session files too? I'm assuming something like |
I see, nice. Re location - I had to find it first :) It saves it to "~/.local/share/NotepadNext/NotepadNext/session/" . so $HOME/.local/... |
Hmmm, ok. The Qt documentation for standard paths is a bit fuzzy, so it saved to a semi-sane location on Windows but didn't know what that would look like on other systems. |
I think that's quite legit. ~/.config/NotepadNext/session/ would be ok as well. Eventually a config setting with the recent defaults could make sense. But at the end of the day ~/.local/share/.. is ok, as it's nothing a user would ever like to move to another machine :) edit: or rather: "It can be totally irrelevant to the user". |
Nice |
Thanks for your speedy work, and for the mention :) The latest build is becoming my driver. There is one thing though, double clicking generates incremented "New X", but if closed w/o saving, on a new creation it still increments - so create "New 2" > close "New 2", create a new one gives "New 3" > close w/o saving > create a new one gives "New 4" etc. Would it be easy to check on this, even if it's not really a show-stopper? It would make it even more consistent. |
This is actually a preexisting bug (not sure if this PR made it worse or not) but even in the official v0.5.6 release I can recreate it by:
This was one of the bugs I ran across and thought I introduced it with these changes but there is at least some not-desirable behavior that already exists. Appreciate you testing things and providing feedback! |
Let's be frank, It's not really a bug, maybe just some polishing. Something else, would a dark mode be a lot of work? But this would extend it over original Notepad++'s features. Thanks again for your work |
Agreed
Yes and no. Getting something basic is easy, to really polish it would probably take a bit of time. There may be existing 3rd party dark theme css files that would work well but I haven't tested them. You can load custom css files: see #171 (comment) Not something I'll be working on myself any time soon. There are other non-Windows systems that have Qt theming built-in so it carries over to Notepad Next: #109 (comment) |
Thanks for the hint. As it's mainly about the editor background that would need to be dark, I'll be waiting. There really is no hurry. |
This is a first attempt at saving/loading a user's session between application restarts.
This feature is not enabled by default. This needs enabled through the preferences dialog.
This feature does not currently save temporary files (that will come later). This base functionality is needed before temporary files can be properly saved/loaded.TODO:
New 1
can be loaded from the session,File > New
would then also createNew 1
C:\dir1\test.txt
andC:\dir2\test.txt
both get saved astext.txt
and will overwite each other.