NPP No Longer Remembers Previous Search Criteria
-
Recently, NPP stopped remembering my previous searches. Instead, when I bring up Find in Files, it thinks my previous search was the lower case letter ell (‘l’).
I have version 8.1.5, 64-bit. Search mode = Normal, Match Case, searching standard HTML files.
This has been working fine for years, and is now broken. I do remember updating to the latest version recently. Not sure if the problem began happening immediatley after.
Any ideas?
-
It sounds like maybe you lost write-permission to your config.xml configuration file, or that file somehow got corrupted. (Maybe it was accidentally set to be Admin owner, but you are now using your non-Admin account, or similar). Try exiting Notepad++, renaming the config file to something else, and then re-start Notepad++; then try a few searches, and see if it remembers them inside the current session and into the next session.
-
@dick-adams-0 Not sure why, but the config.xml isn’t in the folder the help page says it should be in (%AppData%\Notepad++). Rather, it is in AppData\Roaming\Notepad++.
So I renamed the config.xml there, but it had no effect.
Any ideas?
-
the help page says it should be in (%AppData%\Notepad++). Rather, it is in AppData\Roaming\Notepad++.
The helpfile correctly says that that it’s in
%AppData%\Notepad++
, because%AppData%
resolves on you system to...\AppData\Roaming
, so%AppData%\Notepad++
will go exactly where you ended up finding it. See our AppData FAQ for more.So I renamed the config.xml there, but it had no effect.
The correct steps are
- Exit all instances of Notepad++
- Rename the config.xml
- Start Notepad++ again
- Notepad++ will use the default config settings
- If you exit Notepad++ again, the config.xml should have been re-created with default values
You should share your ?-menu’s Debug Info contents by copying from that dialog and pasting here. (This confirms for us various environmental conditions which may help us give you better advice.)
You should look into permissions in your
%AppData%\Notepad++
folder – for the folder, and for the files under it, and make sure you are allowed to add files and edit files in that folder. -
@dick-adams-0 said in NPP No Longer Remembers Previous Search Criteria:
when I bring up Find in Files, it thinks my previous search was the lower case letter ell (‘l’).
BTW: are you sure you didn’t have a lower-case
l
selected when you opened Find in Files? Because unless you’ve changed your settings so that Settings > Preferences > Searching > Don’t fill find field in Find dialog with selected word is checked instead of the default unchecked, if you have text selected when you open that dialog, it will auto-populate the FIND field. -
@dick-adams-0 I just looked at the config.xml which NPP re-created after I renamed the old one. Buried in the middle were two curious entries:
<Find name="%20" /> <Find name="l" />
The first Find element is the my most recent search string, which NPP is forgetting (%20). I was searching for a URL-encoded space character.
The second Find element is the search string which NPP presents as the default when I next enter Search-Find in Files (l).
Is it possible the percent sign in %20 is confusing NPP?
-
If I try reproducing what you see I get:
But then when I reinvoke Find I see:
Which seems correct to me.
-
I started up a clean v8.1.5 (so default settings, plugins, etc), and searched for 1, 2, 3, space, and
last
. I exited Notepad++ and re-ran it. My FIND dialog and config.xml look like:That’s exactly what I would expect. The only way I could get
%20
in the FIND history is if I actually searched for those characters.You are going to have to provide us with more information – including that which has already been asked for but not given – because we cannot replicate your problem as it stands.
? > Debug Info
Notepad++ v8.1.5 (64-bit)
Build time : Sep 26 2021 - 15:23:23
Path : C:\usr\local\apps\npp\npp.8.1.5.portable.x64\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 2009
OS Build : 19042.1288
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll -
I think I may have solved the mystery (and found a new one)
On my latest attempt to find %20, when I started NPP, I noticed the new document, which appears by default, had a single character, a lower case ell, and it was highlighted.
So, when I chose find-and-replace, NPP thought the highlighted ell was what I wanted to search for. So that explains the pre-filled ell in in the find/replace dialog.
I suspect the ell in the “new document” was probably a typo that had been introduced many sessions ago, and it was such a short string, I had not noticed it. When I deleted the ell in the new document, the suggested search string was %20 as expected/desired.
But that brings up another question:
Why would NPP think I wanted new documents to start with the letter ell? I never saved the new document, so why did NPP keep presenting it with a single letter ell when I launched NPP? Is that normal behavior?
-
@dick-adams-0 said in NPP No Longer Remembers Previous Search Criteria:
Why would NPP think I wanted new documents to start with the letter ell?
It doesn’t.
never saved the new document, so why did NPP keep presenting it with a single letter ell when I launched NPP? Is that normal behavior?
N++ by default remembers unsaved changes to documents. Yes, it is normal behavior. You can change the way N++ handles this so that you get prompted to save/discard any unsaved changes when Notepad++ exits, if you want that behavior.
I’d say what happened was that you somehow “fat fingered” an
l
into your document, you never noticed it, and it just “hung around” as an unsaved change. N++ had no way of knowing it was unintentional.