Using the Language Editor
-
Is there a way to be able to edit and save one’s preferred Language tool? If I want to change my language selection (dBasePlus) for example, is there a way to load, edit, and SAVE NPP’s provided dBasePlus language pack? What’s provided in NPP doesn’t permit SAVING, only creating a new language. The tools provided only allow creating a new language, not changing an existing language. This is risky because it’s possible to lose one’s changes completely. The result is I avoid trying to save changes so as not to lose my edits. Not good!
-
You are very vague, but I’m guessing you mean the User Defined Language (“UDL”) system, given the language you are talking about. My answer will assume that as the basis for my response. When asking questions about Notepad++, it’s really best to use the terminology used in the app itself, otherwise it’s really hard for people reading your question to be sure that you and they are talking about the same thing.
When I first started replying, I hadn’t yet figured out what you were asking about. I literally had to start typing replies to various of your really confusing sentences multiple times before I started guessing what you were actually trying to say.
If I want to change my language selection (dBasePlus) for example, is there a way to load, edit, and SAVE NPP’s provided dBasePlus language pack?
Notepad++ does not provide a dBasePlus “language pack”. dBasePlus is not one of the built-in languages provided by Notepad++. There is a dBasePlus UDL provided by @Lycan-Thrope through the User Defined Language (UDL) Collection, but that’s something that a fellow Notepad++ user supplied, distributed through a publically-contributable collection.
What’s provided in NPP doesn’t permit SAVING, only creating a new language.
The tools provided only allow creating a new language, not changing an existing language.Instead of providing you with a Save button, it automatically saves changes: When you make a change to a UDL in the Language > User Defined Language > Define You Language… dialog, it immediately applies those changes, so they are active. And once you exit Notepad++, at the same time that Notepad++ writes the changes to all its other config files, it writes the changes to the UDL as well.
This is risky because it’s possible to lose one’s changes completely.
How? At this point, Notepad++ is really good at intercepting the “windows crashed or is rebooting and needs to close this applcation” message, and responding appropriately by saving all the appropriate config files. But in very rare crash conditions, it is minutely possible to loose the changed settings – it’s a <0.1% chance, so highly unlikely.
Other than that, I cannot think of any likely way that it would lose your changes to the UDL.
Even if you have multiple instances of Notepad++ open, it does what I believe to be the reasonable thing,
- Open two instances of Notepad++ (for example, using the
-multiInstflag) - Pick one of the two instances of Notepad++, and change the foreground color in a UDL
- That instance will immediately reflect the change (though admittedly, other instances will not, because when you use multi-instance mode, each instance has its own internal variables)
- Close the instance where you changed the foreground color: look at the date and time of the UDL definition file, and you will see it was written at the time you closed the instance of notepad++
- Wait a minute or two, then close the other instance: it did not ovewrite your UDL definition, because that instance had no changes to make.
- Start Notepad++: it will be using the new color, not the old.
The only way you could “lose” a change, even with multi-instance, is if you made a different change in each instance – for example, if in instance 1, you changed forground to RED, and in instance 2, you added a new word to a keyword list, then whichever Notepad++ you close last, that will be the one whose current UDL settings will be saved. But to me, that’s reasonably logical (given the constraints that multiple instances of Notepad++ don’t propagate settings changes from one to the other).
If that’s too confusing, don’t use Notepad++ in multi-instance mode (or don’t change settings or UDL definitions when you have multiple instancs open).
The result is I avoid trying to save changes so as not to lose my edits. Not good!
What do you mean by “avoid trying to save changes so as not to lose my edits”?
If you’re really worried about a crash causing Notepad++ to lose the changes you made to a UDL, then immediately after making the changes, exit Notepad++, which will force Notepad++ to save the changes to disk. If you’re worried about multiple instances not doing what you mean when you edit a UDL, then only edit a UDL when you have one instance open, and exit Notepad++ immediately after verifying the change in order to ensure it’s immediately and unambiguously saved to disk.
If what you are saying is “Despite all you described about how Notepad++ automatically saves UDL when it exits, I would still really like a Save button in the User Defined Language dialog/panel to make sure that UDL is saved to disk immediatelly”, then that’s a reasonable feature request; but you’d actually have to go to the right location to make a feature request (as described in our Feature Request FAQ); and when you do make such a feature request, you would need to make sure your request uses words like “User Defined Language dialog” , rather than making up your own terms and hoping that the developer understands which features you are actually talking about. (I am personally doubtful that such a feature would be implemented; the Notepad++ philosophy seems to be “wait to save any config file until the application exits”, and I’m not sure that philosophy is going to change; also, unfortunately, UDL feature requests and bug reports are rarely addressed anymore; but that’s not to say that you shouldn’t make the feature request, just that you shouldn’t be surprised if nothing happens with it.)
- Open two instances of Notepad++ (for example, using the