[8.7.1] File doesn't open expected file in list
-
Hello,
I’m running 8.7.1 and noticed N++ doesn’t open the right file in the list in the File menu > recently-opened files.
It’s not even the previous/next (7/9 in the screenshot), so it doesn’t look like a one-off error.
Cheers,
-
@Shohreh ,
You will have to be more specific. I have never had difficulty with the Recent Files list – whether I click on one of the entries to re-open that specific file, or whether I use Restore Recent Closed File, which for me has always opened the file I most-recently closed, never off-by-one.
So, if you have a different experience, you will need to give an exact sequence of steps that is reproduceable by anyone. Also share your ?-menu’s Debug Info, because maybe there’s a plugin installed that will influence things.
-
@PeterJones Thanks. I can’t figure out why it’s not working as expected. I’ll see if I find the cause of the problem.
-
Open a file: The file is not added to the list of recent files (the list between “Print now” and “Restore Recent Closed File”) even after editing the file
-
File > Empty Recent Files List does nothing
-
-
@Shohreh said in [8.7.1] File doesn't open expected file in list:
Open a file: The file is not added to the list of recent files (the list between “Print now” and “Restore Recent Closed File”) even after editing the file
The “recent file list” is a list of files that have been recently closed, not recently opened; no file will enter that list until you close it.
See the User Manual’s description for the Recent Files feature.
-
@Shohreh said in [8.7.1] File doesn't open expected file in list:
File > Empty Recent Files List does nothing
Are you sure about this?
Do you have one or more files appearing in the list before you try that command? -
@Alan-Kilborn After editing a file, it’s still not listed in Files at the bottom as I expected (eg. UltraEdit).
After restarting N+, the list is still empty.
I checked/unchecked Settings > Preferences > Recent Files History “In submenu”, it makes no difference: The file is still not listed.
-
You’re actually closing the file you expect to see in Recent Files, right?
As Peter said, it isn’t a “recent file” upon opening, only upon closing. -
@Shohreh said in [8.7.1] File doesn't open expected file in list:
@Alan-Kilborn After editing a file, it’s still not listed in Files at the bottom as I expected (eg. UltraEdit).
Yuo misunderstood him. You had originally stated that File > Empty Recent Files List did nothing. @Alan-Kilborn took issue with that: it did something, it just didn’t have the effect of putting your file in the list. The action it took was it emptied your recent files list – took all the names of the files out of that list.
After restarting N+, the list is still empty.
In Notepad++ nomenclature (and every other text editor I’ve used over the last few decades, including UltraEdit), exiting the application and closing a file are two separate actions. Notepad++ does not necessarily consider a file closed just because you exited the Noteapd++ application and re-ran the application. If you want Notepad++ to add the file to the list of recently closed files, you have to close it, in Notepad++'s understanding of the verb “to close”, which is by using the File > Close action, or the toolbar equivalent, or the X button on the tab. As far as you have described, you haven’t performed the act of closing the file yet. As soon as you do, you will see the file’s path end up in the Recent Files list.
I checked/unchecked Settings > Preferences > Recent Files History “In submenu”, it makes no difference: The file is still not listed.
Clicking the checkmark off and back on won’t add the file to the list of files that have been closed. Only closing the file will do that.
I hope this time, I was more clear, and you are able to learn how to add a file to the list. If not, I am not capable of teaching you.
-
@PeterJones said:
exiting the application and closing a file are two separate actions
Interestingly…
But wait…first @Shohreh should NOT read this post to avoid any further confusion! Danger! Warning!
Continuing…
The act of exiting Notepad++ will cause the open tab files to actually close, at least with the settings I use: “Enable session snapshot” unchecked.
I found this out because a short time ago I was experimenting with the FILEBEFORECLOSE notification and I noticed that it would be called when I exited Notepad++ (once for each tab), not just when I manually closed a file.So what Notepad++ is doing is closing out all of the tabs after writing the default session data to
session.xml
.
(It makes sense because this act of closing is (probably) what causes the prompt-to-save for any unsaved tabs.)
When Notepad++ is next started, it reads the session file and opens the files it finds there.In this case, even though files are being closed, they aren’t saved in the “recent files” list. There must be something in the code that prevents this from happening during closure via shutdown.
In theory, it could add these closed files to the “recent” list, and then remove them on the next startup (because files that are opening are removed from the list), but I don’t think this happens because the list is of relatively small length and this extra saving/restoring would push legitimate list entries off the end of the list. -
@Alan-Kilborn said in [8.7.1] File doesn't open expected file in list:
In this case, even though files are being closed, they aren’t saved in the “recent files” list. There must be something in the code that prevents this from happening during closure via shutdown.