[NEW_FEATURE] Add COBOL, D, Gui4Cli, PowerShell and R language support (in progress).

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@552 f5eea248-9336-0410-98b8-ebc06183d4e3
remotes/x64
Don Ho 15 years ago
parent 8c3485289f
commit 4b1812816f

@ -25,7 +25,7 @@ enum LangType {L_TXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
L_TEX, L_FORTRAN, L_BASH, L_FLASH, L_NSIS, L_TCL, L_LISP, L_SCHEME,\
L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,\
L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,\
L_CMAKE, L_YAML,\
L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R,\
// The end of enumated language type, so it should be always at the end
L_EXTERNAL};
enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7};

@ -351,10 +351,13 @@ void PluginsManager::setMenu(HMENU hMenu, const TCHAR *menuName)
::InsertMenu(hMenu, 9, MF_BYPOSITION | MF_POPUP, (UINT_PTR)_hPluginsMenu, nom_menu);
}
for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
size_t i = 0;
for ( ; i < _pluginInfos.size() ; i++)
{
addInMenuFromPMIndex(i);
}
//::InsertMenu(_hPluginsMenu, i++, MF_BYPOSITION, (unsigned int)-1, 0);
//::InsertMenu(_hPluginsMenu, i++, MF_BYPOSITION, (UINT_PTR)_hPluginsMenu, TEXT("BlackList"));
}
}

@ -5098,6 +5098,17 @@ enum LangType Notepad_plus::menuID2LangType(int cmdID)
return L_CMAKE;
case IDM_LANG_YAML :
return L_YAML;
case IDM_LANG_COBOL :
return L_COBOL;
case IDM_LANG_D :
return L_D;
case IDM_LANG_GUI4CLI :
return L_GUI4CLI;
case IDM_LANG_POWERSHELL :
return L_POWERSHELL;
case IDM_LANG_R :
return L_R;
case IDM_LANG_USER :
return L_USER;
default: {

@ -4537,6 +4537,21 @@ int NppParameters::langTypeToCommandID(LangType lt) const
case L_YAML :
id = IDM_LANG_YAML; break;
case L_COBOL :
id = IDM_LANG_COBOL; break;
case L_D :
id = IDM_LANG_D; break;
case L_GUI4CLI :
id = IDM_LANG_GUI4CLI; break;
case L_POWERSHELL :
id = IDM_LANG_POWERSHELL; break;
case L_R :
id = IDM_LANG_R; break;
case L_SEARCHRESULT :
id = -1; break;

@ -181,7 +181,6 @@ void Buffer::setFileName(const TCHAR *fn, LangType defaultLang)
newLang = L_CMAKE;
else if ((!generic_stricmp(_fileName, TEXT("SConstruct"))) || (!generic_stricmp(_fileName, TEXT("SConscript"))))
newLang = L_PYTHON;
}
updateTimeStamp();

@ -104,6 +104,11 @@ LanguageName ScintillaEditView::langNames[L_EXTERNAL+1] = {
{TEXT("searchResult"), TEXT("Internal Search"), TEXT("Internal Search"), L_SEARCHRESULT, SCLEX_SEARCHRESULT},
{TEXT("cmake"), TEXT("CMAKEFILE"), TEXT("CMAKEFILE"), L_CMAKE, SCLEX_CMAKE},
{TEXT("yaml"), TEXT("YAML"), TEXT("YAML Ain't Markup Language"), L_YAML, SCLEX_YAML},
{TEXT("cobol"), TEXT("COBOL"), TEXT("COmmon Business Oriented Language"), L_COBOL, SCLEX_COBOL},
{TEXT("gui4cli"), TEXT("Gui4Cli"), TEXT("Gui4Cli file"), L_GUI4CLI, SCLEX_GUI4CLI},
{TEXT("d"), TEXT("D"), TEXT("D programming language"), L_D, SCLEX_D},
{TEXT("powershell"), TEXT("PowerShell"), TEXT("Windows PowerShell"), L_POWERSHELL, SCLEX_POWERSHELL},
{TEXT("r"), TEXT("R"), TEXT("R programming language"), L_R, SCLEX_R},
{TEXT("ext"), TEXT("External"), TEXT("External"), L_EXTERNAL, SCLEX_NULL}
};
@ -1256,6 +1261,21 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
case L_YAML :
setYamlLexer(); break;
case L_COBOL :
setCobolLexer(); break;
case L_GUI4CLI :
setGui4CliLexer(); break;
case L_D :
setDLexer(); break;
case L_POWERSHELL :
setPowerShellLexer(); break;
case L_R :
setRLexer(); break;
case L_TXT :
default :
if (typeDoc >= L_EXTERNAL && typeDoc < NppParameters::getInstance()->L_END)

@ -802,6 +802,26 @@ protected:
setLexer(SCLEX_YAML, L_YAML, LIST_0);
};
//--------------------
void setCobolLexer() {
setLexer(SCLEX_COBOL, L_COBOL, LIST_0 | LIST_1 | LIST_2);
};
void setGui4CliLexer() {
setLexer(SCLEX_GUI4CLI, L_GUI4CLI, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4);
};
void setDLexer() {
setLexer(SCLEX_D, L_D, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
};
void setPowerShellLexer() {
setLexer(SCLEX_POWERSHELL, L_POWERSHELL, LIST_0 | LIST_1 | LIST_2);
};
void setRLexer() {
setLexer(SCLEX_R, L_R, LIST_0 | LIST_1 | LIST_2);
};
//--------------------
void setSearchResultLexer() {
execute(SCI_STYLESETEOLFILLED, SCE_SEARCHRESULT_FILE_HEADER, true);
execute(SCI_STYLESETEOLFILLED, SCE_SEARCHRESULT_SEARCH_HEADER, true);

@ -261,8 +261,13 @@
#define IDM_LANG_INNO (IDM_LANG + 47)
#define IDM_LANG_CMAKE (IDM_LANG + 48)
#define IDM_LANG_YAML (IDM_LANG + 49)
#define IDM_LANG_COBOL (IDM_LANG + 50)
#define IDM_LANG_D (IDM_LANG + 51)
#define IDM_LANG_GUI4CLI (IDM_LANG + 52)
#define IDM_LANG_POWERSHELL (IDM_LANG + 53)
#define IDM_LANG_R (IDM_LANG + 54)
#define IDM_LANG_EXTERNAL (IDM_LANG + 50)
#define IDM_LANG_EXTERNAL (IDM_LANG + 65)
#define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 79)
#define IDM_LANG_USER (IDM_LANG + 80) //46080

Loading…
Cancel
Save