You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While responding to "Save as .md default" on the forum, I found that there are two related feature requests implied in that discussion. I will submit those as two issues here, because they would affect two different sections of the codebase.
Please include the loaded UDL languages (with their list of extensions) in the Save As dialog's dropdown list of Save As types.
(I looked for and couldn't find a previous issue on this, though I am surprised it's not there; maybe I haven't used the right search terms)
From a technical perspective, I have been telling people, including the person from the linked Forum post, that it was technically not feasible to add new types to the Save As list. But then I remembered that you can change the priority of extensions by editing langs.xml, so I tried the experiment of adding <Language name="Fake" ext="fak fake false"/> and restarting Notepad++ -- and lo and behold, I see that it does get added! (And if .fak is associated with a UDL, then once the save-as is done, the Language gets set to the "Fake" UDL.) Seen this screenshot:
Unfortunately, it calls it "Normal text file (*.fak; *.fake; .false)" instead of "Fake (.fak; *.fake; *.false)". And to make this work, the user would have to manually add a line to langs.xml for every UDL they want listed. So that's a possible workaround, but not the best.
But since that experiment showed that the SaveAs list is dynamically generated, then it should be possible during the Notepad++ load/initialization to go through the list of UDL, and create a new SaveAs name and extension list based on the information in userDefineLang.xml and userDefineLangs\*.xml. I understand if it's too many hooks to have it add every time a new UDL is defined or imported, but at least on program load, if it could add UDLs to the list, that would be great. (You might even want to prefix those entries with UDL... but maybe not.)
Notepad++ v8.2 (64-bit)
Build time : Dec 30 2021 - 03:40:42
Path : C:\usr\local\apps\npp\npp.8.2.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.1466
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll
The text was updated successfully, but these errors were encountered:
It's the logical conclusion of #8083 -- rather than being for one UDL, this is requesting for all UDL, which is probably easier to implement than just hand-picking which UDL go into the SaveAs pulldown. (Also, that issue claimed that the Save As list is Scintilla-dependent ... but based on my experiments with just editing langs.xml, which is a Notepad++-specific config file, I don't think that the Save As list is really Scintilla-based. But I'm not an expert on the codebase.)
This is fantastic idea - and, in my opinion, a much-needed feature. If we can add our own user-defined languages, it makes perfect sense for those to be included in the Save As dialog. In fact, being able to add any other extensions we like (even if we don't have a UDL for them) should be considered, too.
While responding to "Save as .md default" on the forum, I found that there are two related feature requests implied in that discussion. I will submit those as two issues here, because they would affect two different sections of the codebase.
Please include the loaded UDL languages (with their list of extensions) in the Save As dialog's dropdown list of Save As types.
(I looked for and couldn't find a previous issue on this, though I am surprised it's not there; maybe I haven't used the right search terms)
From a technical perspective, I have been telling people, including the person from the linked Forum post, that it was technically not feasible to add new types to the Save As list. But then I remembered that you can change the priority of extensions by editing
langs.xml
, so I tried the experiment of adding<Language name="Fake" ext="fak fake false"/>
and restarting Notepad++ -- and lo and behold, I see that it does get added! (And if .fak is associated with a UDL, then once the save-as is done, the Language gets set to the "Fake" UDL.) Seen this screenshot:Unfortunately, it calls it "Normal text file (*.fak; *.fake; .false)" instead of "Fake (.fak; *.fake; *.false)". And to make this work, the user would have to manually add a line to
langs.xml
for every UDL they want listed. So that's a possible workaround, but not the best.But since that experiment showed that the SaveAs list is dynamically generated, then it should be possible during the Notepad++ load/initialization to go through the list of UDL, and create a new SaveAs name and extension list based on the information in
userDefineLang.xml
anduserDefineLangs\*.xml
. I understand if it's too many hooks to have it add every time a new UDL is defined or imported, but at least on program load, if it could add UDLs to the list, that would be great. (You might even want to prefix those entries with UDL... but maybe not.)The text was updated successfully, but these errors were encountered: