Feature Request:Restrict entries to Recent File List based on path/regex
-
Hello!
I love Notepad++ and use it for everything. Often, I use it to check log files which I will never open again. Other times I open a file from a restricted secure path and would prefer not to see it in my Recent File List.
I propose a simple blacklist that, when configured, would not add an opened file to the Recent File List if it was from a specified drive/path/regex. The options could be added simply to the Settings → Preferences → Recent Files History option dialog.
This way, for the log files, my Recent File list won’t fill up with files I no longer care about, and thus push the ones I would want to open again down off the list. It also could be configured so that files from a certain path no longer are added to the Recent File List, so that any secured restricted files, for example, are also not added.
Obviously, blacklisting Recent File List items from a whole drive is easier than blacklisting items from a specific path which is easier than blacklisting items using a regex. One additional feature could also allow blacklisting an entry to the Recent File List that matches a specific file association, *.tmp for example.
I would like to hear what others think and if anyone has any suggestions or comments.
-
Firstly, feature requests won’t be seen by the “powers that be” here. See the FAQ for how to make a true feature request.
Secondly, your request could probably be implemented with some “scripting”. When completed, using it would go like this:
You want to see your recent files history, so you press a keycombo assigned to bring that up. A new tab opens to show you your history, including doing any filtering you’d like and probably also showing you how long it has been since you’ve closed each listed file. You can select a file(s) in the text of this tab in order to re-open that file(s). You close this tab and the old file(s) is opened.
Just some ideas I had about how it could be done…
-
@RandalR Though my intent is not to hide or conceal the recent files list I already do what you are proposing by not using the recent file list. At present I left my copy of Notepad++ configured at the default of 10 recent files but would not care if it was smaller.
I open the files I edit frequently using shortcuts. Many of my shortcuts are
.bat
batch files with many of them doing various tests and computations to figure out which file(s) to open. Thus, I don’t care if the recent file history overflows with junk.While most of my shortcuts end up using the main copy of Notepad++.exe installed on my machine a few of them seek out and open portable copies of Notepad++ and start those copies with the
-multiInst
command line option. This has an unintended, but desirable to you, side affect of not adding files I view/edit to Notepad++'s recent file history.I could set
Preferences / Recent Files History / Max number of Entries
to 0 in one or more of my portable copies of Notepad++. Files opened with that copy will not show up in Notepad++'s recent files history list.If you want to remove or hide files that are already listed in the recent history then you have a couple of options already available.
- Use the
File / Empty Recent Files List
menu option. If I found myself doing this a lot then I would assign a keyboard shortcut to it. - Shut down Notepad++ and edit its config.xml file. The recent file list is in the
History
section of the file. You could also script this to close Notepad, clean up the history list, and to restart Notepad.
You mentioned that you have secret paths to some of your files. My first thought was that if you had a list of files that you don’t want to get added to the recent file list then the secret paths would end up being public as they are in the list of files to hide.
If you start using portable copies of Notepad++ you will discover that there is no way to control which instance of Notepad++ is used when starting a copy of Notepad++.exe. This Notepad++ forum thread from 2020 discusses the issue with a workaround mentioned in the last comment.
- Use the
-
@Alan-Kilborn
My workaround for avoiding having temporary files added to the Recent Files list is to open a new N++ window; I just have to remember to close any secondary windows before closing the original window, so that the original window’s Recent File list overwrites anything the secondary windows wrote to the config. This is in effect taking advantage of N++'s, um, “shortcoming” that prevents the config files from being edited from within N++. (This is also why I quickly gave up trying to develop a scripted alternative to this procedure.) -
@TBugReporter I agree about the shortcoming. It’s a non-trivial problem which likely explains why it has not been fixed. For example, we could add better instance control but what should happen if multiple instances are sharing a config.xml file? Various plugins also have their own configuration storage and likely are not set up to allow multiple instances. Should adding a word to a spell checker dictionary immediately appear in all instances?
-
I might try to open a PR to fix this if people think there’s a decent chance of Don Ho accepting it. My gut tells me that this is the kind of thing that Don would reject even if it was implemented correctly (which is nontrivial as others have noted), but I could be wrong.
-
@Mark-Olson said in Feature Request:Restrict entries to Recent File List based on path/regex:
My gut tells me that this is the kind of thing that Don would reject
Listen to your gut – it is smart.
-
My gut tells me that this is the kind of thing that Don would reject
@Alan-Kilborn said:
Listen to your gut – it is smart.
When I made this comment, I thought you were talking about the “recent file list” part of this thread, but now I think you meant the “multi-instance” part.
My gut tells me that your gut is smart on EITHER aspect. :-)
But… if you did come up with a solution to the multi-instance thing, and it was really slick and it covered every possible problem that could arise, and it didn’t take a lot of code changes, then I think it might have a chance of being accepted.
-
@Alan-Kilborn
No, I was talking about the “recent file list” thing. The “multi-instance” thing seems like it would be much harder to deal with, which is too bad, because it seems like a more annoying bug. -
@RandalR - While I upvoted your original request at the top of the thread please don’t take it as a “vote” that the idea you presented should be implemented as how you proposed.
Some sort of control over what gets added to the the recent files or history list is something I suspect many people have thought about at times. However, every time I start thinking through “that file should not be in my recent files or history list” I recall instances where it was useful that the file was recorded in the history. Thus for myself, I’d continue with allowing everything to get recorded in the recent file history even i an option was available.
I proposed a workaround of using separate copies or instances of Notepad++ dedicated to files that you know you don’t want to ever show up in the recent files or history of your main copy of Notepad++. While that works for managing the history list the idea also runs into the already known can of worms, Pandora’s Box, of how to gracefully handle multiple instances… There is interest in eventually solving the instance problem.