Does not save the files I need to use
-
I’m very new to Notepad ++ but every time I add the five files that I need to use (Settings>Preferences>Files Association>Supported Extensions>Registered Extensions) and close and reopen the app; there are about fifteen extra files listed as Registered Extensions. When I remove the unwanted files, they reappear when I reopen the app. Any advice?
-
Sorry but I don’t understand what you are trying to do. Can you make a screenshot,
upload to image hosters like imgur.com and attach it, by using the syntax![](URL_OF_SCREENSHOT)
in your post?
Cheers
Claudia -
The OP was also pursuing this on the Live Support forum and I also suggested a screenshot…and one was provided there…but no other help was given there by anyone (and I have no idea)…maybe you do or someone else here does. So here’s the screenshot:
-
Scott, thanks for helping out and it looks like it is a bug.
Did a simple test with 5 custom extensions and couple more appeared after restart.
Try to investigate what the issue could be.Cheers
Claudia -
so it looks like there is a problem when reading the file extension registration from registry
because it will report all extensions as being registered which use the same first letter and
are sorted after the custom registered extension.Example - I registered .bcd which resulted in showing up bcd and bmp as being registered.
But regedit proves that bmp isn’t a registered extensions.While registering bop didn’t add any other extension (because there is no other b… extensions after it.)
Try to see if I find the offending code part.
Cheers
Claudia -
Curious - which operating system do you use?
In addition, can you post debug-info which can be found under ? menu ?Reason for asking is that I have different behavior with different wine (windows layer on linux) configuration.
Cheers
Claudia -
Thank you both, @Scott-Sumner, @Claudia-Frank for replying to my question. @Claudia-Frank my OS is Windows 10, here’s the debug-info:
Notepad++ v7.5.3 (32-bit)
Build time : Dec 5 2017 - 10:45:46
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll -
-
@Claudia-Frank thanks for the help, much appreciated.
-
I assume I found the issue - in short, it is a permission issue.
Could you try the following
run regedit
open the first key HKEY_CLASSES_ROOT
you now see a list of subkeys starting with . (dot)
select for example the .ibq(I get this from your the screenshot and I think this is one of the extensions you did not set)
right click on .ibq and select permission
now you should see that the user account you are logged in has not been listed
add it and assign full control
start notepad++ and check file association - I assume you still have the same values until ibq but nothing afterwards unless
it is another registered extension.Basically the code issue is, only confirmed by reading the code and manipulating registry, that
notepad++ doesn’t check all registry calls if they are successful
and I assume that in case you read an extension successfully
and this extension is a npp registered file
all subsequent failed registry reads are counted as successful
unless you read a key successfully which isn’t a npp registered extension.Tested on linux, so I would appreciate if one could check on windows to see if this is really the case.
Cheers
Claudia -
The following is splitted into several posts as it is flagged as spam, maybe it is who knows.
OK - so I started my win10 virtualbox and did the test and can confirm reported behavior.
Here the screenshots which description what I’ve done.I’m trying to assign .bat. From npp it looks like it is done but registry editor proves that Notepad++_file has NOT been created.
Reason, the user doesn’t have sufficient permissionsCheers
Claudia -
Adding my user to the .bat key and assigning FULL CONTROL resolves this
but now we do have a different issue (well it is the issue OP reported)
As shown (for blg), all keys starting from .bcp to .blg don’t have my account (admin)
whereas the next key .bmpdoes have it set. So by adding my account to .bcp and restarting notepad++ problem is solved (for this area only).
Cheers
Claudia -
So this leads to the assumption that the code (File is regExtDlg.cpp)
which in general works has a problem when a call fails and as we see that some calls are just called without checking
the return code I assume that is where the issue starts. ( Not only this part of the code needs improvement)Edit - cannot post code part as it is flagged as spam.
Cheers
Claudia -
@Claudia-Frank
Thank you so much for replying and your help. You solved my problem, thank you again and HAPPY NEW YEAR!!! -
Claudia,
I see this exact behavior on my Windows 7 dev machine. For each file extension that I want Notepad++ to open with, I must ensure that I have full access to the file extension I want, e.g. .py, and the NEXT file extension in the list, in my case, .qcp. Otherwise, the first case will prevent Notepad++ from saving the .py setting (with no error indication) although it will appear in the file association list until Notepad++ is restarted; and the second case will cause the additional spurious extensions starting from .qcp to be added to the list.
BTW I’m using 7.5.4.
Thanks so much for investigating and giving us a workaround.
Tom -
Claudia,
BTW, I wanted to add .frm and .rpt but Notepad++ couldn’t add those either because there are no keys for those two. I added them manually.
Thanks
Tom -
Tom,
thank you very much for your additional testing and investigation on this topic.
Very much appreciated. Your additional tip should help others too to overcome this limitation.Cheers
Claudia -
Concerning the wrongly shown file extensions.
The above screenshots about .bat registered but dialog
shows additional extensions being registered.This drove me some nuts.
Whenever I tried to do the same with python and ctypes it worked but
npp showed clearly it isn’t.I assume I finally understood what the issue is,
it is within RegExtDlg::getRegisteredExts()There is no check if RegOpenKeyEx or RegQueryValueEx succeeded or failed but
one could assume that it isn’t necessary as the next if clause checks the previously
generated variables valType and valData and if the two reg calls fail then
those two variables are invalid.Well, I don’t think this is the case. If I understood correctly what I read it happens
that those variables hold the state from the last successful registry calls
and I guess this explains very well why we see what we see.So in theory a modification like
... TCHAR valData[extNameLen]{'\0'}; ... int valType = 0;
should do the trick.
Can someone with a more solid c++ knowledge confirm if this is the case?
Thank you and cheers
Claudia