@@ -274,12 +274,13 @@ bool CollectionInterface::getListsFromJson(void)
274274 for (const auto & item : jUdl[" UDLs" ].items ()) {
275275 auto j = item.value ();
276276 std::wstring ws_id_name = string2wstring (j[" id-name" ].get <std::string>());
277+ std::wstring ws_display_name = string2wstring (j[" display-name" ].get <std::string>());
277278 std::wstring udl_base = L" https://raw.githubusercontent.com/notepad-plus-plus/userDefinedLanguages/master/" ;
278279
279280 // Logic for UDL -> URL
280281 if (j.contains (" repository" )) {
281282 std::wstring sUDL = L" " ;
282- if (j[" repository" ].is_boolean ()) { // URL repo should never be boolean; but if it is, generate default URL
283+ if (j[" repository" ].is_boolean ()) { // URL repo should never be boolean; but if it is, generate default URL (doesn't matter whether true or false, need a URL either way)
283284 sUDL = udl_base + L" UDLs/" + ws_id_name + L" .xml" ;
284285 }
285286 if (j[" repository" ].is_string ()) {
@@ -312,9 +313,12 @@ bool CollectionInterface::getListsFromJson(void)
312313 // Logic for functionList -> URL
313314 if (j.contains (" functionList" )) {
314315 std::wstring wsFuncList = L" " ;
316+ // if functionList boolean=True, generate filename from ID
315317 if (j[" functionList" ].is_boolean () && j[" functionList" ].get <bool >()) {
316318 wsFuncList = udl_base + L" functionList/" + ws_id_name + L" .xml" ;
317319 }
320+ // if functionList boolean=False, don't need a wsFuncList entry, so leave as "" with no IF statement
321+ // if functionList is string, use that string for URL or filename, as appropriate.
318322 if (j[" functionList" ].is_string ()) {
319323 std::wstring ws = string2wstring (j[" functionList" ].get <std::string>());
320324
@@ -335,9 +339,12 @@ bool CollectionInterface::getListsFromJson(void)
335339 // Logic for autoCompletion -> URL
336340 if (j.contains (" autoCompletion" )) {
337341 std::wstring wsAutoComp = L" " ;
338- if (j[" autoCompletion" ].is_boolean ()) {
339- wsAutoComp = udl_base + L" autoCompletion/" + ws_id_name + L" .xml" ;
342+ // if boolean=True, generate name from DISPLAY name
343+ if (j[" autoCompletion" ].is_boolean () && j[" autoCompletion" ].get <bool >()) {
344+ wsAutoComp = udl_base + L" autoCompletion/" + ws_display_name + L" .xml" ;
340345 }
346+ // if boolean=False, don't need wsAutoComp defined at all..., so no IF needed
347+ // if string, extract the value and check for URL vs repo
341348 if (j[" autoCompletion" ].is_string ()) {
342349 std::wstring ws = string2wstring (j[" autoCompletion" ].get <std::string>());
343350 if (ws.find (L" http" ) == 0 ) {
0 commit comments