Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allow UDLs in "Save As" filetypes #11096

Open
pryrt opened this issue Jan 27, 2022 · 3 comments
Open

Feature Request: Allow UDLs in "Save As" filetypes #11096

pryrt opened this issue Jan 27, 2022 · 3 comments
Labels
udl Everything related to User Defined Language

Comments

@pryrt
Copy link
Contributor

pryrt commented Jan 27, 2022

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 
@ArkadiuszMichalski ArkadiuszMichalski added the udl Everything related to User Defined Language label Jan 28, 2022
@ArkadiuszMichalski
Copy link
Contributor

Related #8083.

@pryrt
Copy link
Contributor Author

pryrt commented Jan 28, 2022

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.)

@kiwichick888
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
udl Everything related to User Defined Language
Projects
None yet
Development

No branches or pull requests

3 participants