The program forgets settings. Inconvenient view defaults
-
@Taras-Tkachenko said in The program forgets settings. Inconvenient view defaults:
It seems that the program forgets at least this setting after the computer is restarted and maybe when it goes into sleep mode.
It should not do that.
That sounds like either you are using multi-instance mode, and you are changing the setting in one of the instances that doesn’t have the “lock” on writing to the config files (only the first copy opened in multi-instance mode is allowed to write the settings to disk); or you have the wrong write-permissions in the folder storing the
config.xml
(usually%AppData%\Notepad++\config.xml
, but it depends on your setup)But I can be more specific if you share your ?-menu’s Debug Info – that will answer some or all of the questions, after which I or others will be able to ask more direct questions.
Also this late version I’m using does not automatically show all files in the working folder.
There is no version for which that statement is true, in my experience: Notepad++ lists all the files in the working folder when using File > Open, unless you apply a filter. If Windows is hiding files (protected files, or similar), then the same would be true in Windows Explorer, and you can use Windows Explorer settings to change what’s shown in N++ File > Open dialogs, as well.
Now it defaults to TXT every time, every new complete start of the program or every once in a while - possibly another part of its memory that gets reset.
No such thing happens for me. File > Open never has a filter : even when my active file is a Perl script (
blah.pl
), File > Open properly defaults to showing all types
I create a new file, go to Save As and see an empty folder that is actually full of D files because the new file is TXT by default
Ahh… Save As is different than Open dialogs. IF you have applied a file type to the new file (manually using the Language menu to set the type before you do Save As), then it will default to filtering for that active type, like:
However, you are correct, if you have a
new #
file that hasn’t had a language attached, it will assume a text file (*.txt*
) as the filter. You can then click on the Filter’s drop-down and chooseD programming language (*.d)
if that’s what you want to filter by.If you want the default language for new files (ie, when you use File > New or equivalent) touse the D language by default, then you can change Settings > Preferences > New Document > Default language using the dropdown:
After doing that, when you hit New, the file will start out being of typeD programming language
and the File > SaveAs filter will default to the D filter, rather than the txt filter.
(If you have a few different “default” languages, depending on what you’re working on that’s ot as practical; if you are in a situation like that – like maybe you want to create new D files and new python.py
files with about equal probability – then you can look here for a post where I describe how to create a macro that makes a new file, and changes the language on that new file; and if you wanted, here shows an expanded macro that also immediately runs Save As on your brand-new document after it creates it and sets the language; with either of those styles of macro, you could create two of those macros (one for D, one for PY) with different keyboard shortcuts, and use those shortcuts to create the files instead of using the File > New.That said, the Filter is easily ignorable in the Save As dialog. If you want to save
new 1
asabc123.d
, you can type that, and it will use that name, no matter what the filter is currently set to, and it will save it to that name (and pick the right Language as a result). I rarely (almost never? maybe once in decades of use) want to create a new file and then overwrite an existing name, so I guess not seeing all the files doesn’t bother me, or I’m willing to click in the Filter box and pick “All Types”, which is immediately above “Normal text file”, if I really must see all the existing filenames this time. -
@PeterJones That is a very long and detailed answer. I appreciate your writing it, but that is a lot of setting and tuning simply to have a convenient, ready-to-go text editor. It’s like having to learn to drive in order to warm up a chicken in a microwave. I can live with all of those little snags except the one with not seeing all compatible file types, or all file types altogether.
I don’t know at what point in the development this setting was introduced, but in the old, 2017 version I used until recently I would click on Save As and see all compatible files in the folder. Or maybe just all files in the folder. Having to click on “All types” is not convenient: first, it is an extra click in a small menu every time, second, the list of file types is so long that “All types” has to be scrolled up to. You should make “All types” the default in Save As. I don’t understand why it isn’t. Why would you make the user purblind when saving?
I’ll explain why it is especially inconvenient for me. I’m writing many files that are to be compiled from the same folder, some are D and others are BAF. D is the format that Weidu, the program for making mods for the Infinity engine of old RPGs, compiles into DLG, the official file type of dialogues, and BAFs get turned into BCSs, game scripts. When I have started writing either a D or a BAF and want to save it, I need to see the currently present files of the same type in the folder to know if I would be overwriting anything with the file name I have in mind. I can’t remember all that is there. Have I made AR3201.BAF yet, in fact a small extension of the existing game script for area AR3201, or is this the first time I turn to change that area script? How many ready dialogues have I prepared and should I add this one or is it better to stop and discard what is written? I need to see the landscape. Instead I see a blank screen, because there are no TXT files in the folder.
P. S. Debug information to understand why the settings don’t stay on (I will try disabling the change-tracking again now):
Notepad++ v8.5 (32-bit)
Build time : Mar 6 2023 - 02:15:26
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : ON
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 7 Ultimate (32-bit)
OS Build : 7601.0
Current ANSI codepage : 1251
Plugins :
mimeTools (2.9)
NppConverter (4.5)
NppExport (0.4) -
@Taras-Tkachenko said in The program forgets settings. Inconvenient view defaults:
You should make “All types” the default in Save As.
I am not the Developer. I can do no such thing. (This forum is the Community of users of Notepad++. While I have contributed to the codebase, I am a fellow user, and don’t have decision-level power for Notepad++ code/design/UI/UX decisions.)
that is a lot of setting and tuning simply to have a convenient, ready-to-go text editor.
You can make some people happy some of the time, and all people happy none of the time. For many people, it is already convenient, ready-to-go.
The Developer made his design decisions, and you’d have to convince him. not me, that it would be better to cater to your preferred setup than to the one he already intentionally chose. We have a FAQ explaining how to make a feature request, but I would warn you that you’d have to do a better job of convincing him the change is necessary.
I’ll explain why it is especially inconvenient for me …
I understand that can be annoying. If you create an empty file in Explorer with the right extension, then RightClick>OpenWithNotepad++, it will be of the right type already. Or you could do the ONE TIME setup of the two macros I recommended, and use those instead of File > New to create your new files. I understand that I wrote a lot, but setting up the macros ONE TIME, to then be always available thereafter, is not really all that onerous (IMO); and I know how hard it is to learn to do something other than File>New when creating new files, but once you do, your problem would be solved, without any trying to convince the Developer (not me) that your way is better than his way, or waiting for it to be implemented (if ever). Using those macros means that the instant you have a new file, you get the syntax highlighting you want for that specific filetype, rather than having to wait until you get around to doing the SaveAs; and if you do, then the SaveAs will automatically start with just the revelant extension, rather than showing you all the files in the directory (which would be very useful for a mixed-type folder).
Regarding losing settings:
Admin mode : ON
Local Conf mode : OFFThe losing the settings is probably because you are currently in Admin mode and maybe sometimes are not. My guess is there is a permissions-issue between the config files being stored in
%AppData%\Notepad++\
and your normal user. Don’t run in Admin mode unless you have to. If you do have to be in Admin mode sometimes (and unless you are always editing inC:\Program Files\
orC:\Windows\
, I can almost guarantee that you don’t have to be, most of the time), then if you have the permissions opened up, it might make it so that when you switch back to normal mode, it you should still be able to read/write the settings files. (But I have never spent long periods running Notepad++ as Admin, so I don’t know for sure what steps it takes, and whether it will change the permissions onconfig.xml
and similar config files.) If you really think you do need to be running as Admin often, you might want to explain why, because we might be able to help you get the same behavior without always/usually/often being Admin.But, either way, I would look at
%AppData%\Notepad++
, and check with Windows Explorer whether the directories and files have read/write access for both your normal user and your Admin user. (Right Clicking on each directory and file, and look at permissions.) If you don’t have write permission, you will need to add it, because otherwise you won’t be able to overwrite the settings. I cannot guarantee that running as Admin won’t change the permissions back (I hope it doesn’t, but it would be good to know if that happens for you – we might be able to put in a feature request, if it does). -
@PeterJones Writing macros in place of a normal menu command is like riding a bicycle to make your omlette. It also shows a passivity before what is obviously a flaw. A small flaw, but in a long menu and without seeing what else is in the folder an annoying one. I had assumed you were somehow influential here, otherwise why would you spend so much time writing up those long answers? But I will file a feature request.
-
@Taras-Tkachenko said in The program forgets settings. Inconvenient view defaults:
Writing macros in place of a normal menu command is like riding a bicycle to make your omlette
Nonsense. Your hyperbole went way too far, and you know it.
If you want an omlette analogy, Notepad++ is much more akin to giving the user an omlette, and giving them access to salt and pepper shakers, Tabasco sauce, and a selection of mushrooms and bell peppers and habeneros and other such things to add on top of their omlette if the standard omlette is not flavored quite to your liking; you might prefer that the chef added in the mixins for you, but since you are getting the omlette for free, and the other ingredients are provided for you if you are willing to use them, the chef decided to not spend time with the made-to-order omlettes, so he could focus on his skillset of turning eggs into excellent omlettes, and the users could customize to taste.
I had assumed you were somehow influential here, otherwise why would you spend so much time writing up those long answers?
“here” is not where you seem to think it is. I am here, in the Community Forum, because I have spent a decade helping people, because I love Notepad++ and want other people to learn how to use it better. “here” is not the codebase, “here” is the Community Forum.
-
Alternate workaround, while waiting for the Developer to implement your feature request (or if he rejects it):
edit%AppData%\Notepad++\langs.xml
, near the top
was:<Language name="normal" ext="txt"/>
to:
<Language name="normal" ext="txt *"/>
Save. Restart Notepad++. Now every time you do a SaveAs from a new file, it will show all files, even though it it still says Save as type:
Normal text file
… because the extension list is now(*.txt; *.*)
That, once again, requires only a single change to a config file on your part (only microscopically more difficult than changing a setting in the GUI), and unlike the macro suggestion, doesn’t otherwise require you putting in any extra effort or thought into your workflow.
-
As an appendix to my posts: I have been posting lots of workarounds for the SaveAs, because I am doubtful that the Developer will listen.
The Developer added the automatic SaveAs filter, so that if you had a file that was already a “D” file (for example), but wanted to Save it as another filename, the SaveAs would default to the right extension, which was quite useful (and a feature I agree with). However, it had the unintended consequence of making SaveAs more inconvenient for anyone who wants to save to various plain text types that don’t happen to be
*.txt
: not every text file – not even every “plain text” file – ends with.txt
, and to enforce only that filter when doing a SaveAs seems a bad idea. I am not certain (it was years ago, and I don’t know that a search on my part would find it), but I thought this was previously pointed out and he rejected the argument, but maybe I’m misremembering, and back then, I just wasn’t willing to give him my full opinion or something.It would actually be nice if a SaveAs after a File > New defaulted to All Files (unless you have the Settings > Preferences > New Document > Default language set to something other than
None (Normal Text)
), so I am actually rooting for your feature request (as long as it doesn’t ruin SaveAs when the filetype is something other than Normal Text).I don’t like it when people blame us in the Forum for the Developer’s decisions (whether or not we agree with those decisions), and I will admit I took your reply too personally, and ramped up my response when I shouldn’t have. But I really do provide my super-detailed responses because I want people to be able to use Notepad++ with as little barrier to convenience as possible; and when I cannot fix it for them, or when I am doubtful that the Developer will implement what they want, I do my best to provide one or more workarounds. I’m sorry if I got to defensive (or went into offensive territory.)
So, since you don’t like my other suggestions, I really hope you are willing to try to use the
langs.xml
edit, because I think it will give you what you want, without having to rely on or wait for the Developer to implement what you ask for. Good luck. -
I can’t fully tell what @Taras-Tkachenko is wanting here (because I’ve never understood the “massive problems” people have in regards to saving and extensions), so this may be off-base, but perhaps leaving the Append extension checkbox uncheckmarked in the Save As dialog helps in some way?
Also, the root of the problem seems to be in detecting that saving a new file doesn’t collide with the name of an existing file. Why not just let it collide if it is going to – Notepad++ will tell you – and then, choose a different name?
-
@PeterJones said:
<Language name=“normal” ext=“txt *”/>
Now every time you do a SaveAs from a new file, it will show all files, even though it it still says Save as type: Normal text fileNote that this requires the Append extension checkbox to be checkmarked.
-
@Taras-Tkachenko ,
@PeterJones has been trying to help you, but you don’t seem to be able to be helped.I downloaded version 8.5 32 bit:
Notepad++ v8.5 (32-bit) Build time : Mar 6 2023 - 02:15:26 Path : C:\Users\<username>\Documents\Development Tools Downloads\Notepad++ Versions\npp.8.5.portable\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : ON Cloud Config : OFF OS Name : Windows 10 Home (64-bit) OS Version : 22H2 OS Build : 19045.5608 Current ANSI codepage : 1252 Plugins : mimeTools (2.9) NppConverter (4.5) NppExport (0.4)
And made my default file choice to be the D language, made a file, saved it. Created new, saved it, and in that directory was the other D file that I had just created. I shut down the application, came back, started a new document, saved it, and it too, defaulted to the same directory that my previous opened file was pointing to, and when I saved the newly created document, it too had the default extension of .d and the other .d files and only the other .d files were present in the dialog box.
I think you’re trolling, or lying. There is no
forgetting
. the file extension set from theSettings->Preferences...->New Document->Default language:
dialog box selection area.From what I can see, you are not using the application properly, or not as you described. So unless you can take the time to properly describe EXACTLY what you are doing I don’t think @PeterJones or anyone else on here should bother giving you anymore suggestions until you stop with the vague decscriptions of your problem or the snide comments about a contributing forum member regardless of how you percieve their
influence
.I tried doing the things you say, and unless you are Using the Open Files Dialog box like below, then yes, you will have the
*.*
file listing:And any file in there will be shown. If your directory only has the files you described in your use case, then those files will be there, only.
If you instead use the Save As Dialog, then the only thing you will see with the default file extension .d will be shown as this shows below:
As you can see, only the files that you have saved with the same file extension will be in there. From my view, I’ve just done everything you said you couldn’t do. So which is it? Trolling, lying or is it just being purposely dense?
If someone offers you a way to do what you want, regardless of the
way
it is done, and seems like it’s too much trouble, then just say thank you for the effort, but it seems to difficult to do, or you’re too lazy to do it (I say that all the time about myself), but you’ll make a suggestion the proper way to the developers…and then move on. No need for the entitled attitude.