diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index d21f74622..3609926ad 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1542,22 +1542,26 @@ void Notepad_plus::checkLangsMenu(int id) const ::CheckMenuRadioItem(_mainMenuHandle, IDM_LANG_C, IDM_LANG_USER_LIMIT, id, MF_BYCOMMAND); } -generic_string Notepad_plus::getLangDesc(LangType langType, bool shortDesc) +generic_string Notepad_plus::getLangDesc(LangType langType, bool getName) { if ((langType >= L_EXTERNAL) && (langType < NppParameters::getInstance()->L_END)) { ExternalLangContainer & elc = NppParameters::getInstance()->getELCFromIndex(langType - L_EXTERNAL); - if (shortDesc) + if (getName) return generic_string(elc._name); else return generic_string(elc._desc); - } + } if (langType > L_EXTERNAL) langType = L_TEXT; - generic_string str2Show = ScintillaEditView::langNames[langType].longName; + generic_string str2Show; + if (getName) + str2Show = ScintillaEditView::langNames[langType].shortName; + else + str2Show = ScintillaEditView::langNames[langType].longName; if (langType == L_USER) { diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 6e89d9e74..55358089b 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -470,7 +470,7 @@ private: void enableConvertMenuItems(formatType f) const; void checkUnicodeMenuItems() const; - generic_string getLangDesc(LangType langType, bool shortDesc = false); + generic_string getLangDesc(LangType langType, bool getName = false); void setLangStatus(LangType langType){ _statusBar.setText(getLangDesc(langType).c_str(), STATUSBAR_DOC_TYPE); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 2f4b9bead..e4ca4fcc8 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1772,7 +1772,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa case NPPM_GETLANGUAGENAME: { - generic_string langName = getLangDesc((LangType)wParam, false); + generic_string langName = getLangDesc((LangType)wParam, true); if (lParam) lstrcpy((LPTSTR)lParam, langName.c_str()); return langName.length(); @@ -1780,7 +1780,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa case NPPM_GETLANGUAGEDESC: { - generic_string langDesc = getLangDesc((LangType)wParam, true); + generic_string langDesc = getLangDesc((LangType)wParam, false); if (lParam) lstrcpy((LPTSTR)lParam, langDesc.c_str()); return langDesc.length(); diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 1cb96e76a..85d9cca6a 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -434,7 +434,7 @@ int Notepad_plus::setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType) const TCHAR *filters = stringFilters.c_str(); if (filters[0]) { - fDlg.setExtsFilter(getLangDesc(lid, true).c_str(), filters); + fDlg.setExtsFilter(getLangDesc(lid, false).c_str(), filters); // // Get index of lang type to find