mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-04-08 17:15:37 +02:00
Use string lexer ID instead of numeric ID for Scintilla 5
Plus some factoring. Close #11472
This commit is contained in:
parent
121a396bf0
commit
2113e782fb
2
.gitignore
vendored
2
.gitignore
vendored
@ -55,6 +55,8 @@ UpgradeLog*.htm
|
||||
*.bak
|
||||
|
||||
PowerEditor/bin/notepad++.exe
|
||||
PowerEditor/bin/Notepad++.exp
|
||||
PowerEditor/bin/Notepad++.lib
|
||||
PowerEditor/bin/SciLexer.dll
|
||||
PowerEditor/bin/config.xml
|
||||
PowerEditor/bin/stylers.xml
|
||||
|
@ -23,7 +23,6 @@ class FileNameStringSplitter
|
||||
public:
|
||||
FileNameStringSplitter(const TCHAR *fileNameStr)
|
||||
{
|
||||
//if (!fileNameStr) return;
|
||||
TCHAR *pStr = NULL;
|
||||
bool isInsideQuotes = false;
|
||||
const int filePathLength = MAX_PATH;
|
||||
|
@ -101,7 +101,7 @@ static WORD getBinaryArchitectureType(const TCHAR *filePath)
|
||||
#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000
|
||||
#endif
|
||||
|
||||
int PluginsManager::loadPlugin(const TCHAR *pluginFilePath)
|
||||
int PluginsManager::loadPluginFromPath(const TCHAR *pluginFilePath)
|
||||
{
|
||||
const TCHAR *pluginFileName = ::PathFindFileName(pluginFilePath);
|
||||
if (isInLoadedDlls(pluginFileName))
|
||||
@ -281,15 +281,17 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath)
|
||||
}
|
||||
catch (generic_string& s)
|
||||
{
|
||||
if (pi && pi->_hLib)
|
||||
{
|
||||
::FreeLibrary(pi->_hLib);
|
||||
}
|
||||
|
||||
s += TEXT("\n\n");
|
||||
s += pluginFileName;
|
||||
s += USERMSG;
|
||||
if (::MessageBox(NULL, s.c_str(), pluginFilePath, MB_YESNO) == IDYES)
|
||||
if (::MessageBox(_nppData._nppHandle, s.c_str(), pluginFilePath, MB_YESNO) == IDYES)
|
||||
{
|
||||
if (pi && pi->_hLib)
|
||||
{
|
||||
::FreeLibrary(pi->_hLib);
|
||||
}
|
||||
|
||||
::DeleteFile(pluginFilePath);
|
||||
}
|
||||
delete pi;
|
||||
@ -297,16 +299,17 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
if (pi && pi->_hLib)
|
||||
{
|
||||
::FreeLibrary(pi->_hLib);
|
||||
}
|
||||
|
||||
generic_string msg = TEXT("Failed to load");
|
||||
msg += TEXT("\n\n");
|
||||
msg += pluginFileName;
|
||||
msg += USERMSG;
|
||||
if (::MessageBox(NULL, msg.c_str(), pluginFilePath, MB_YESNO) == IDYES)
|
||||
if (::MessageBox(_nppData._nppHandle, msg.c_str(), pluginFilePath, MB_YESNO) == IDYES)
|
||||
{
|
||||
if (pi && pi->_hLib)
|
||||
{
|
||||
::FreeLibrary(pi->_hLib);
|
||||
}
|
||||
::DeleteFile(pluginFilePath);
|
||||
}
|
||||
delete pi;
|
||||
@ -314,7 +317,7 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath)
|
||||
}
|
||||
}
|
||||
|
||||
bool PluginsManager::loadPluginsV2(const TCHAR* dir, const PluginViewList* pluginUpdateInfoList)
|
||||
bool PluginsManager::loadPlugins(const TCHAR* dir, const PluginViewList* pluginUpdateInfoList)
|
||||
{
|
||||
if (_isDisabled)
|
||||
return false;
|
||||
@ -465,7 +468,7 @@ bool PluginsManager::loadPluginsV2(const TCHAR* dir, const PluginViewList* plugi
|
||||
|
||||
for (size_t i = 0, len = dllNames.size(); i < len; ++i)
|
||||
{
|
||||
loadPlugin(dllNames[i].c_str());
|
||||
loadPluginFromPath(dllNames[i].c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -86,8 +86,7 @@ public:
|
||||
_nppData = nppData;
|
||||
}
|
||||
|
||||
int loadPlugin(const TCHAR *pluginFilePath);
|
||||
bool loadPluginsV2(const TCHAR *dir = NULL, const PluginViewList* pluginUpdateInfoList = nullptr);
|
||||
bool loadPlugins(const TCHAR *dir = NULL, const PluginViewList* pluginUpdateInfoList = nullptr);
|
||||
|
||||
bool unloadPlugin(int index, HWND nppHandle);
|
||||
|
||||
@ -127,6 +126,8 @@ private:
|
||||
IDAllocator _markerAlloc;
|
||||
bool _noMoreNotification = false;
|
||||
|
||||
int loadPluginFromPath(const TCHAR* pluginFilePath);
|
||||
|
||||
void pluginCrashAlert(const TCHAR *pluginName, const TCHAR *funcSignature)
|
||||
{
|
||||
generic_string msg = pluginName;
|
||||
|
@ -409,7 +409,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
_pluginsManager.init(nppData);
|
||||
|
||||
bool enablePluginAdmin = _pluginsAdminDlg.initFromJson();
|
||||
_pluginsManager.loadPluginsV2(nppParam.getPluginRootDir(), enablePluginAdmin ? &_pluginsAdminDlg.getAvailablePluginUpdateInfoList() : nullptr);
|
||||
_pluginsManager.loadPlugins(nppParam.getPluginRootDir(), enablePluginAdmin ? &_pluginsAdminDlg.getAvailablePluginUpdateInfoList() : nullptr);
|
||||
_restoreButton.init(_pPublicInterface->getHinst(), hwnd);
|
||||
|
||||
// ------------ //
|
||||
@ -2375,9 +2375,9 @@ generic_string Notepad_plus::getLangDesc(LangType langType, bool getName)
|
||||
|
||||
generic_string str2Show;
|
||||
if (getName)
|
||||
str2Show = ScintillaEditView::langNames[langType].shortName;
|
||||
str2Show = ScintillaEditView::_langNameInfoArray[langType]._shortName;
|
||||
else
|
||||
str2Show = ScintillaEditView::langNames[langType].longName;
|
||||
str2Show = ScintillaEditView::_langNameInfoArray[langType]._longName;
|
||||
|
||||
if (langType == L_USER)
|
||||
{
|
||||
@ -4287,7 +4287,7 @@ void Notepad_plus::docOpenInNewInstance(FileTransferMode mode, int x, int y)
|
||||
if (lt != L_USER)
|
||||
{
|
||||
command += TEXT(" -l");
|
||||
command += ScintillaEditView::langNames[lt].lexerName;
|
||||
command += ScintillaEditView::_langNameInfoArray[lt]._langName;
|
||||
}
|
||||
command += TEXT(" -n");
|
||||
command += to_wstring(_pEditView->getCurrentLineNumber() + 1);
|
||||
|
@ -2875,7 +2875,7 @@ std::pair<unsigned char, unsigned char> NppParameters::feedUserLang(TiXmlNode *n
|
||||
}
|
||||
|
||||
}
|
||||
catch (const std::exception& /*e*/)
|
||||
catch (const std::exception&)
|
||||
{
|
||||
delete _userLangArray[--_nbUserLang];
|
||||
}
|
||||
@ -3959,7 +3959,7 @@ LangType NppParameters::getLangIDFromStr(const TCHAR *langName)
|
||||
int lang = static_cast<int32_t>(L_TEXT);
|
||||
for (; lang < L_EXTERNAL; ++lang)
|
||||
{
|
||||
const TCHAR * name = ScintillaEditView::langNames[lang].lexerName;
|
||||
const TCHAR * name = ScintillaEditView::_langNameInfoArray[lang]._langName;
|
||||
if (!lstrcmp(name, langName)) //found lang?
|
||||
{
|
||||
return (LangType)lang;
|
||||
|
@ -1077,6 +1077,6 @@ const TCHAR * AutoCompletion::getApiFileName()
|
||||
if (_curLang == L_JAVASCRIPT)
|
||||
_curLang = L_JS;
|
||||
|
||||
return ScintillaEditView::langNames[_curLang].lexerName;
|
||||
return ScintillaEditView::_langNameInfoArray[_curLang]._langName;
|
||||
|
||||
}
|
||||
|
@ -1447,11 +1447,8 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil
|
||||
|
||||
if (fileFormat._language < L_EXTERNAL)
|
||||
{
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4996)
|
||||
const char* pName = LexerNameFromID(ScintillaEditView::langNames[fileFormat._language].lexerID); //deprecated, therefore disabled warning
|
||||
#pragma warning( pop )
|
||||
_pscratchTilla->execute(SCI_SETILEXER, 0, reinterpret_cast<LPARAM>(CreateLexer(pName)));
|
||||
const char* lexerNameID = ScintillaEditView::_langNameInfoArray[fileFormat._language]._lexerID;
|
||||
_pscratchTilla->execute(SCI_SETILEXER, 0, reinterpret_cast<LPARAM>(CreateLexer(lexerNameID)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -18,8 +18,6 @@
|
||||
#include <shlwapi.h>
|
||||
#include "FindReplaceDlg.h"
|
||||
#include "ScintillaEditView.h"
|
||||
#include <ILexer.h>
|
||||
#include <Lexilla.h>
|
||||
#include "Notepad_plus_msgs.h"
|
||||
#include "localization.h"
|
||||
#include "Utf8.h"
|
||||
@ -554,7 +552,7 @@ void Finder::deleteResult()
|
||||
auto end = _scintView.execute(SCI_GETLINEENDPOSITION, lno);
|
||||
if (start + 2 >= end) return; // avoid empty lines
|
||||
|
||||
_scintView.setLexer(SCLEX_SEARCHRESULT, L_SEARCHRESULT, LIST_NONE); // Restore searchResult lexer in case the lexer was changed to SCLEX_NULL in GotoFoundLine()
|
||||
_scintView.setLexer(L_SEARCHRESULT, LIST_NONE); // Restore searchResult lexer in case the lexer was changed to SCLEX_NULL in GotoFoundLine()
|
||||
|
||||
if (_scintView.execute(SCI_GETFOLDLEVEL, lno) & SC_FOLDLEVELHEADERFLAG) // delete a folder
|
||||
{
|
||||
@ -2314,7 +2312,11 @@ int FindReplaceDlg::processRange(ProcessOperation op, FindReplaceInfo & findRepl
|
||||
if (!isCreated() && !findReplaceInfo._txt2find)
|
||||
return nbProcessed;
|
||||
|
||||
if (!_ppEditView)
|
||||
return nbProcessed;
|
||||
|
||||
ScintillaEditView *pEditView = *_ppEditView;
|
||||
|
||||
if (view2Process)
|
||||
pEditView = view2Process;
|
||||
|
||||
@ -4311,7 +4313,7 @@ void Finder::setFinderStyle()
|
||||
NppDarkMode::setBorder(_scintView.getHSelf());
|
||||
|
||||
// Set current line background color for the finder
|
||||
const TCHAR * lexerName = ScintillaEditView::langNames[L_SEARCHRESULT].lexerName;
|
||||
const TCHAR * lexerName = ScintillaEditView::_langNameInfoArray[L_SEARCHRESULT]._langName;
|
||||
LexerStyler *pStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(lexerName);
|
||||
if (pStyler)
|
||||
{
|
||||
|
@ -61,94 +61,97 @@ const int ScintillaEditView::_markersArray[][NB_FOLDER_STATE] = {
|
||||
|
||||
// Array with all the names of all languages
|
||||
// The order of lang type (enum LangType) must be respected
|
||||
LanguageName ScintillaEditView::langNames[L_EXTERNAL + 1] = {
|
||||
{TEXT("normal"), TEXT("Normal text"), TEXT("Normal text file"), L_TEXT, SCLEX_NULL},
|
||||
{TEXT("php"), TEXT("PHP"), TEXT("PHP Hypertext Preprocessor file"), L_PHP, SCLEX_HTML},
|
||||
{TEXT("c"), TEXT("C"), TEXT("C source file"), L_C, SCLEX_CPP},
|
||||
{TEXT("cpp"), TEXT("C++"), TEXT("C++ source file"), L_CPP, SCLEX_CPP},
|
||||
{TEXT("cs"), TEXT("C#"), TEXT("C# source file"), L_CS, SCLEX_CPP},
|
||||
{TEXT("objc"), TEXT("Objective-C"), TEXT("Objective-C source file"), L_OBJC, SCLEX_OBJC},
|
||||
{TEXT("java"), TEXT("Java"), TEXT("Java source file"), L_JAVA, SCLEX_CPP},
|
||||
{TEXT("rc"), TEXT("RC"), TEXT("Windows Resource file"), L_RC, SCLEX_CPP},
|
||||
{TEXT("html"), TEXT("HTML"), TEXT("Hyper Text Markup Language file"), L_HTML, SCLEX_HTML},
|
||||
{TEXT("xml"), TEXT("XML"), TEXT("eXtensible Markup Language file"), L_XML, SCLEX_XML},
|
||||
{TEXT("makefile"), TEXT("Makefile"), TEXT("Makefile"), L_MAKEFILE, SCLEX_MAKEFILE},
|
||||
{TEXT("pascal"), TEXT("Pascal"), TEXT("Pascal source file"), L_PASCAL, SCLEX_PASCAL},
|
||||
{TEXT("batch"), TEXT("Batch"), TEXT("Batch file"), L_BATCH, SCLEX_BATCH},
|
||||
{TEXT("ini"), TEXT("ini"), TEXT("MS ini file"), L_INI, SCLEX_PROPERTIES},
|
||||
{TEXT("nfo"), TEXT("NFO"), TEXT("MSDOS Style/ASCII Art"), L_ASCII, SCLEX_NULL},
|
||||
{TEXT("udf"), TEXT("udf"), TEXT("User Defined language file"), L_USER, SCLEX_USER},
|
||||
{TEXT("asp"), TEXT("ASP"), TEXT("Active Server Pages script file"), L_ASP, SCLEX_HTML},
|
||||
{TEXT("sql"), TEXT("SQL"), TEXT("Structured Query Language file"), L_SQL, SCLEX_SQL},
|
||||
{TEXT("vb"), TEXT("Visual Basic"), TEXT("Visual Basic file"), L_VB, SCLEX_VB},
|
||||
{TEXT("javascript"), TEXT("JavaScript"), TEXT("JavaScript file"), L_JS, SCLEX_CPP},
|
||||
{TEXT("css"), TEXT("CSS"), TEXT("Cascade Style Sheets File"), L_CSS, SCLEX_CSS},
|
||||
{TEXT("perl"), TEXT("Perl"), TEXT("Perl source file"), L_PERL, SCLEX_PERL},
|
||||
{TEXT("python"), TEXT("Python"), TEXT("Python file"), L_PYTHON, SCLEX_PYTHON},
|
||||
{TEXT("lua"), TEXT("Lua"), TEXT("Lua source File"), L_LUA, SCLEX_LUA},
|
||||
{TEXT("tex"), TEXT("TeX"), TEXT("TeX file"), L_TEX, SCLEX_TEX},
|
||||
{TEXT("fortran"), TEXT("Fortran free form"), TEXT("Fortran free form source file"), L_FORTRAN, SCLEX_FORTRAN},
|
||||
{TEXT("bash"), TEXT("Shell"), TEXT("Unix script file"), L_BASH, SCLEX_BASH},
|
||||
{TEXT("actionscript"), TEXT("ActionScript"), TEXT("Flash ActionScript file"), L_FLASH, SCLEX_CPP},
|
||||
{TEXT("nsis"), TEXT("NSIS"), TEXT("Nullsoft Scriptable Install System script file"), L_NSIS, SCLEX_NSIS},
|
||||
{TEXT("tcl"), TEXT("TCL"), TEXT("Tool Command Language file"), L_TCL, SCLEX_TCL},
|
||||
{TEXT("lisp"), TEXT("Lisp"), TEXT("List Processing language file"), L_LISP, SCLEX_LISP},
|
||||
{TEXT("scheme"), TEXT("Scheme"), TEXT("Scheme file"), L_SCHEME, SCLEX_LISP},
|
||||
{TEXT("asm"), TEXT("Assembly"), TEXT("Assembly language source file"), L_ASM, SCLEX_ASM},
|
||||
{TEXT("diff"), TEXT("Diff"), TEXT("Diff file"), L_DIFF, SCLEX_DIFF},
|
||||
{TEXT("props"), TEXT("Properties file"), TEXT("Properties file"), L_PROPS, SCLEX_PROPERTIES},
|
||||
{TEXT("postscript"), TEXT("PostScript"), TEXT("PostScript file"), L_PS, SCLEX_PS},
|
||||
{TEXT("ruby"), TEXT("Ruby"), TEXT("Ruby file"), L_RUBY, SCLEX_RUBY},
|
||||
{TEXT("smalltalk"), TEXT("Smalltalk"), TEXT("Smalltalk file"), L_SMALLTALK, SCLEX_SMALLTALK},
|
||||
{TEXT("vhdl"), TEXT("VHDL"), TEXT("VHSIC Hardware Description Language file"), L_VHDL, SCLEX_VHDL},
|
||||
{TEXT("kix"), TEXT("KiXtart"), TEXT("KiXtart file"), L_KIX, SCLEX_KIX},
|
||||
{TEXT("autoit"), TEXT("AutoIt"), TEXT("AutoIt"), L_AU3, SCLEX_AU3},
|
||||
{TEXT("caml"), TEXT("CAML"), TEXT("Categorical Abstract Machine Language"), L_CAML, SCLEX_CAML},
|
||||
{TEXT("ada"), TEXT("Ada"), TEXT("Ada file"), L_ADA, SCLEX_ADA},
|
||||
{TEXT("verilog"), TEXT("Verilog"), TEXT("Verilog file"), L_VERILOG, SCLEX_VERILOG},
|
||||
{TEXT("matlab"), TEXT("MATLAB"), TEXT("MATrix LABoratory"), L_MATLAB, SCLEX_MATLAB},
|
||||
{TEXT("haskell"), TEXT("Haskell"), TEXT("Haskell"), L_HASKELL, SCLEX_HASKELL},
|
||||
{TEXT("inno"), TEXT("Inno Setup"), TEXT("Inno Setup script"), L_INNO, SCLEX_INNOSETUP},
|
||||
{TEXT("searchResult"), TEXT("Internal Search"), TEXT("Internal Search"), L_SEARCHRESULT, SCLEX_SEARCHRESULT},
|
||||
{TEXT("cmake"), TEXT("CMake"), TEXT("CMake file"), 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("jsp"), TEXT("JSP"), TEXT("JavaServer Pages script file"), L_JSP, SCLEX_HTML},
|
||||
{TEXT("coffeescript"), TEXT("CoffeeScript"), TEXT("CoffeeScript file"), L_COFFEESCRIPT, SCLEX_COFFEESCRIPT},
|
||||
{TEXT("json"), TEXT("json"), TEXT("JSON file"), L_JSON, SCLEX_JSON },
|
||||
{TEXT("javascript.js"), TEXT("JavaScript"), TEXT("JavaScript file"), L_JAVASCRIPT, SCLEX_CPP },
|
||||
{TEXT("fortran77"), TEXT("Fortran fixed form"), TEXT("Fortran fixed form source file"), L_FORTRAN_77, SCLEX_F77},
|
||||
{TEXT("baanc"), TEXT("BaanC"), TEXT("BaanC File"), L_BAANC, SCLEX_BAAN },
|
||||
{TEXT("srec"), TEXT("S-Record"), TEXT("Motorola S-Record binary data"), L_SREC, SCLEX_SREC},
|
||||
{TEXT("ihex"), TEXT("Intel HEX"), TEXT("Intel HEX binary data"), L_IHEX, SCLEX_IHEX},
|
||||
{TEXT("tehex"), TEXT("Tektronix extended HEX"), TEXT("Tektronix extended HEX binary data"), L_TEHEX, SCLEX_TEHEX},
|
||||
{TEXT("swift"), TEXT("Swift"), TEXT("Swift file"), L_SWIFT, SCLEX_CPP},
|
||||
{TEXT("asn1"), TEXT("ASN.1"), TEXT("Abstract Syntax Notation One file"), L_ASN1, SCLEX_ASN1},
|
||||
{TEXT("avs"), TEXT("AviSynth"), TEXT("AviSynth scripts files"), L_AVS, SCLEX_AVS},
|
||||
{TEXT("blitzbasic"), TEXT("BlitzBasic"), TEXT("BlitzBasic file"), L_BLITZBASIC, SCLEX_BLITZBASIC},
|
||||
{TEXT("purebasic"), TEXT("PureBasic"), TEXT("PureBasic file"), L_PUREBASIC, SCLEX_PUREBASIC},
|
||||
{TEXT("freebasic"), TEXT("FreeBasic"), TEXT("FreeBasic file"), L_FREEBASIC, SCLEX_FREEBASIC},
|
||||
{TEXT("csound"), TEXT("Csound"), TEXT("Csound file"), L_CSOUND, SCLEX_CSOUND},
|
||||
{TEXT("erlang"), TEXT("Erlang"), TEXT("Erlang file"), L_ERLANG, SCLEX_ERLANG},
|
||||
{TEXT("escript"), TEXT("ESCRIPT"), TEXT("ESCRIPT file"), L_ESCRIPT, SCLEX_ESCRIPT},
|
||||
{TEXT("forth"), TEXT("Forth"), TEXT("Forth file"), L_FORTH, SCLEX_FORTH},
|
||||
{TEXT("latex"), TEXT("LaTeX"), TEXT("LaTeX file"), L_LATEX, SCLEX_LATEX},
|
||||
{TEXT("mmixal"), TEXT("MMIXAL"), TEXT("MMIXAL file"), L_MMIXAL, SCLEX_MMIXAL},
|
||||
{TEXT("nim"), TEXT("Nim"), TEXT("Nim file"), L_NIM, SCLEX_NIMROD},
|
||||
{TEXT("nncrontab"), TEXT("Nncrontab"), TEXT("extended crontab file"), L_NNCRONTAB, SCLEX_NNCRONTAB},
|
||||
{TEXT("oscript"), TEXT("OScript"), TEXT("OScript source file"), L_OSCRIPT, SCLEX_OSCRIPT},
|
||||
{TEXT("rebol"), TEXT("REBOL"), TEXT("REBOL file"), L_REBOL, SCLEX_REBOL},
|
||||
{TEXT("registry"), TEXT("registry"), TEXT("registry file"), L_REGISTRY, SCLEX_REGISTRY},
|
||||
{TEXT("rust"), TEXT("Rust"), TEXT("Rust file"), L_RUST, SCLEX_RUST},
|
||||
{TEXT("spice"), TEXT("Spice"), TEXT("spice file"), L_SPICE, SCLEX_SPICE},
|
||||
{TEXT("txt2tags"), TEXT("txt2tags"), TEXT("txt2tags file"), L_TXT2TAGS, SCLEX_TXT2TAGS},
|
||||
{TEXT("visualprolog"), TEXT("Visual Prolog"), TEXT("Visual Prolog file"), L_VISUALPROLOG, SCLEX_VISUALPROLOG},
|
||||
{TEXT("typescript"), TEXT("TypeScript"), TEXT("TypeScript file"), L_TYPESCRIPT, SCLEX_CPP},
|
||||
{TEXT("ext"), TEXT("External"), TEXT("External"), L_EXTERNAL, SCLEX_NULL}
|
||||
LanguageNameInfo ScintillaEditView::_langNameInfoArray[L_EXTERNAL + 1] = {
|
||||
//
|
||||
// _langName _shortName _longName _langID _lexerID
|
||||
//
|
||||
{TEXT("normal"), TEXT("Normal text"), TEXT("Normal text file"), L_TEXT, "null"},
|
||||
{TEXT("php"), TEXT("PHP"), TEXT("PHP Hypertext Preprocessor file"), L_PHP, "html"},
|
||||
{TEXT("c"), TEXT("C"), TEXT("C source file"), L_C, "cpp"},
|
||||
{TEXT("cpp"), TEXT("C++"), TEXT("C++ source file"), L_CPP, "cpp"},
|
||||
{TEXT("cs"), TEXT("C#"), TEXT("C# source file"), L_CS, "cpp"},
|
||||
{TEXT("objc"), TEXT("Objective-C"), TEXT("Objective-C source file"), L_OBJC, "objc"},
|
||||
{TEXT("java"), TEXT("Java"), TEXT("Java source file"), L_JAVA, "cpp"},
|
||||
{TEXT("rc"), TEXT("RC"), TEXT("Windows Resource file"), L_RC, "cpp"},
|
||||
{TEXT("html"), TEXT("HTML"), TEXT("Hyper Text Markup Language file"), L_HTML, "html"},
|
||||
{TEXT("xml"), TEXT("XML"), TEXT("eXtensible Markup Language file"), L_XML, "xml"},
|
||||
{TEXT("makefile"), TEXT("Makefile"), TEXT("Makefile"), L_MAKEFILE, "makefile"},
|
||||
{TEXT("pascal"), TEXT("Pascal"), TEXT("Pascal source file"), L_PASCAL, "pascal"},
|
||||
{TEXT("batch"), TEXT("Batch"), TEXT("Batch file"), L_BATCH, "batch"},
|
||||
{TEXT("ini"), TEXT("ini"), TEXT("MS ini file"), L_INI, "props"},
|
||||
{TEXT("nfo"), TEXT("NFO"), TEXT("MSDOS Style/ASCII Art"), L_ASCII, "null"},
|
||||
{TEXT("udf"), TEXT("udf"), TEXT("User Defined language file"), L_USER, "user"},
|
||||
{TEXT("asp"), TEXT("ASP"), TEXT("Active Server Pages script file"), L_ASP, "html"},
|
||||
{TEXT("sql"), TEXT("SQL"), TEXT("Structured Query Language file"), L_SQL, "sql"},
|
||||
{TEXT("vb"), TEXT("Visual Basic"), TEXT("Visual Basic file"), L_VB, "vb"},
|
||||
{TEXT("javascript"), TEXT("JavaScript"), TEXT("JavaScript file"), L_JS, "cpp"},
|
||||
{TEXT("css"), TEXT("CSS"), TEXT("Cascade Style Sheets File"), L_CSS, "css"},
|
||||
{TEXT("perl"), TEXT("Perl"), TEXT("Perl source file"), L_PERL, "perl"},
|
||||
{TEXT("python"), TEXT("Python"), TEXT("Python file"), L_PYTHON, "python"},
|
||||
{TEXT("lua"), TEXT("Lua"), TEXT("Lua source File"), L_LUA, "lua"},
|
||||
{TEXT("tex"), TEXT("TeX"), TEXT("TeX file"), L_TEX, "tex"},
|
||||
{TEXT("fortran"), TEXT("Fortran free form"), TEXT("Fortran free form source file"), L_FORTRAN, "fortran"},
|
||||
{TEXT("bash"), TEXT("Shell"), TEXT("Unix script file"), L_BASH, "bash"},
|
||||
{TEXT("actionscript"), TEXT("ActionScript"), TEXT("Flash ActionScript file"), L_FLASH, "cpp"},
|
||||
{TEXT("nsis"), TEXT("NSIS"), TEXT("Nullsoft Scriptable Install System script file"), L_NSIS, "nsis"},
|
||||
{TEXT("tcl"), TEXT("TCL"), TEXT("Tool Command Language file"), L_TCL, "tcl"},
|
||||
{TEXT("lisp"), TEXT("Lisp"), TEXT("List Processing language file"), L_LISP, "lisp"},
|
||||
{TEXT("scheme"), TEXT("Scheme"), TEXT("Scheme file"), L_SCHEME, "lisp"},
|
||||
{TEXT("asm"), TEXT("Assembly"), TEXT("Assembly language source file"), L_ASM, "asm"},
|
||||
{TEXT("diff"), TEXT("Diff"), TEXT("Diff file"), L_DIFF, "diff"},
|
||||
{TEXT("props"), TEXT("Properties file"), TEXT("Properties file"), L_PROPS, "props"},
|
||||
{TEXT("postscript"), TEXT("PostScript"), TEXT("PostScript file"), L_PS, "ps"},
|
||||
{TEXT("ruby"), TEXT("Ruby"), TEXT("Ruby file"), L_RUBY, "ruby"},
|
||||
{TEXT("smalltalk"), TEXT("Smalltalk"), TEXT("Smalltalk file"), L_SMALLTALK, "smalltalk"},
|
||||
{TEXT("vhdl"), TEXT("VHDL"), TEXT("VHSIC Hardware Description Language file"), L_VHDL, "vhdl"},
|
||||
{TEXT("kix"), TEXT("KiXtart"), TEXT("KiXtart file"), L_KIX, "kix"},
|
||||
{TEXT("autoit"), TEXT("AutoIt"), TEXT("AutoIt"), L_AU3, "au3"},
|
||||
{TEXT("caml"), TEXT("CAML"), TEXT("Categorical Abstract Machine Language"), L_CAML, "caml"},
|
||||
{TEXT("ada"), TEXT("Ada"), TEXT("Ada file"), L_ADA, "ada"},
|
||||
{TEXT("verilog"), TEXT("Verilog"), TEXT("Verilog file"), L_VERILOG, "verilog"},
|
||||
{TEXT("matlab"), TEXT("MATLAB"), TEXT("MATrix LABoratory"), L_MATLAB, "matlab"},
|
||||
{TEXT("haskell"), TEXT("Haskell"), TEXT("Haskell"), L_HASKELL, "haskell"},
|
||||
{TEXT("inno"), TEXT("Inno Setup"), TEXT("Inno Setup script"), L_INNO, "inno"},
|
||||
{TEXT("searchResult"), TEXT("Internal Search"), TEXT("Internal Search"), L_SEARCHRESULT, "searchResult"},
|
||||
{TEXT("cmake"), TEXT("CMake"), TEXT("CMake file"), L_CMAKE, "cmake"},
|
||||
{TEXT("yaml"), TEXT("YAML"), TEXT("YAML Ain't Markup Language"), L_YAML, "yaml"},
|
||||
{TEXT("cobol"), TEXT("COBOL"), TEXT("COmmon Business Oriented Language"), L_COBOL, "COBOL"},
|
||||
{TEXT("gui4cli"), TEXT("Gui4Cli"), TEXT("Gui4Cli file"), L_GUI4CLI, "gui4cli"},
|
||||
{TEXT("d"), TEXT("D"), TEXT("D programming language"), L_D, "d"},
|
||||
{TEXT("powershell"), TEXT("PowerShell"), TEXT("Windows PowerShell"), L_POWERSHELL, "powershell"},
|
||||
{TEXT("r"), TEXT("R"), TEXT("R programming language"), L_R, "r"},
|
||||
{TEXT("jsp"), TEXT("JSP"), TEXT("JavaServer Pages script file"), L_JSP, "html"},
|
||||
{TEXT("coffeescript"), TEXT("CoffeeScript"), TEXT("CoffeeScript file"), L_COFFEESCRIPT, "coffeescript"},
|
||||
{TEXT("json"), TEXT("json"), TEXT("JSON file"), L_JSON, "json "},
|
||||
{TEXT("javascript.js"), TEXT("JavaScript"), TEXT("JavaScript file"), L_JAVASCRIPT, "cpp "},
|
||||
{TEXT("fortran77"), TEXT("Fortran fixed form"), TEXT("Fortran fixed form source file"), L_FORTRAN_77, "f77"},
|
||||
{TEXT("baanc"), TEXT("BaanC"), TEXT("BaanC File"), L_BAANC, "baan "},
|
||||
{TEXT("srec"), TEXT("S-Record"), TEXT("Motorola S-Record binary data"), L_SREC, "srec"},
|
||||
{TEXT("ihex"), TEXT("Intel HEX"), TEXT("Intel HEX binary data"), L_IHEX, "ihex"},
|
||||
{TEXT("tehex"), TEXT("Tektronix extended HEX"), TEXT("Tektronix extended HEX binary data"), L_TEHEX, "tehex"},
|
||||
{TEXT("swift"), TEXT("Swift"), TEXT("Swift file"), L_SWIFT, "cpp"},
|
||||
{TEXT("asn1"), TEXT("ASN.1"), TEXT("Abstract Syntax Notation One file"), L_ASN1, "asn1"},
|
||||
{TEXT("avs"), TEXT("AviSynth"), TEXT("AviSynth scripts files"), L_AVS, "avs"},
|
||||
{TEXT("blitzbasic"), TEXT("BlitzBasic"), TEXT("BlitzBasic file"), L_BLITZBASIC, "blitzbasic"},
|
||||
{TEXT("purebasic"), TEXT("PureBasic"), TEXT("PureBasic file"), L_PUREBASIC, "purebasic"},
|
||||
{TEXT("freebasic"), TEXT("FreeBasic"), TEXT("FreeBasic file"), L_FREEBASIC, "freebasic"},
|
||||
{TEXT("csound"), TEXT("Csound"), TEXT("Csound file"), L_CSOUND, "csound"},
|
||||
{TEXT("erlang"), TEXT("Erlang"), TEXT("Erlang file"), L_ERLANG, "erlang"},
|
||||
{TEXT("escript"), TEXT("ESCRIPT"), TEXT("ESCRIPT file"), L_ESCRIPT, "escript"},
|
||||
{TEXT("forth"), TEXT("Forth"), TEXT("Forth file"), L_FORTH, "forth"},
|
||||
{TEXT("latex"), TEXT("LaTeX"), TEXT("LaTeX file"), L_LATEX, "latex"},
|
||||
{TEXT("mmixal"), TEXT("MMIXAL"), TEXT("MMIXAL file"), L_MMIXAL, "mmixal"},
|
||||
{TEXT("nim"), TEXT("Nim"), TEXT("Nim file"), L_NIM, "nimrod"},
|
||||
{TEXT("nncrontab"), TEXT("Nncrontab"), TEXT("extended crontab file"), L_NNCRONTAB, "nncrontab"},
|
||||
{TEXT("oscript"), TEXT("OScript"), TEXT("OScript source file"), L_OSCRIPT, "oscript"},
|
||||
{TEXT("rebol"), TEXT("REBOL"), TEXT("REBOL file"), L_REBOL, "rebol"},
|
||||
{TEXT("registry"), TEXT("registry"), TEXT("registry file"), L_REGISTRY, "registry"},
|
||||
{TEXT("rust"), TEXT("Rust"), TEXT("Rust file"), L_RUST, "rust"},
|
||||
{TEXT("spice"), TEXT("Spice"), TEXT("spice file"), L_SPICE, "spice"},
|
||||
{TEXT("txt2tags"), TEXT("txt2tags"), TEXT("txt2tags file"), L_TXT2TAGS, "txt2tags"},
|
||||
{TEXT("visualprolog"), TEXT("Visual Prolog"), TEXT("Visual Prolog file"), L_VISUALPROLOG, "visualprolog"},
|
||||
{TEXT("typescript"), TEXT("TypeScript"), TEXT("TypeScript file"), L_TYPESCRIPT, "cpp"},
|
||||
{TEXT("ext"), TEXT("External"), TEXT("External"), L_EXTERNAL, "null"}
|
||||
};
|
||||
|
||||
//const int MASK_RED = 0xFF0000;
|
||||
@ -630,9 +633,10 @@ void ScintillaEditView::setStyle(Style styleToSet)
|
||||
|
||||
void ScintillaEditView::setXmlLexer(LangType type)
|
||||
{
|
||||
setLexerFromLangID(type);
|
||||
|
||||
if (type == L_XML)
|
||||
{
|
||||
setLexerFromID(SCLEX_XML);
|
||||
for (int i = 0 ; i < 4 ; ++i)
|
||||
execute(SCI_SETKEYWORDS, i, reinterpret_cast<LPARAM>(TEXT("")));
|
||||
|
||||
@ -642,7 +646,6 @@ void ScintillaEditView::setXmlLexer(LangType type)
|
||||
}
|
||||
else if ((type == L_HTML) || (type == L_PHP) || (type == L_ASP) || (type == L_JSP))
|
||||
{
|
||||
setLexerFromID(SCLEX_HTML);
|
||||
const TCHAR *htmlKeyWords_generic = NppParameters::getInstance().getWordList(L_HTML, LANG_INDEX_INSTR);
|
||||
|
||||
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
|
||||
@ -681,7 +684,7 @@ void ScintillaEditView::setEmbeddedJSLexer()
|
||||
|
||||
void ScintillaEditView::setJsonLexer()
|
||||
{
|
||||
setLexerFromID(SCLEX_JSON);
|
||||
setLexerFromLangID(L_JSON);
|
||||
|
||||
const TCHAR *pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
|
||||
|
||||
@ -751,7 +754,7 @@ void ScintillaEditView::setEmbeddedAspLexer()
|
||||
void ScintillaEditView::setUserLexer(const TCHAR *userLangName)
|
||||
{
|
||||
int setKeywordsCounter = 0;
|
||||
setLexerFromID(SCLEX_USER);
|
||||
setLexerFromLangID(L_USER);
|
||||
|
||||
UserLangContainer * userLangContainer = userLangName? NppParameters::getInstance().getULCFromName(userLangName):_userDefineDlg._pCurrentUserLang;
|
||||
|
||||
@ -917,7 +920,7 @@ void ScintillaEditView::setCppLexer(LangType langType)
|
||||
const char *cppTypes;
|
||||
const TCHAR *doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
|
||||
|
||||
setLexerFromID(SCLEX_CPP);
|
||||
setLexerFromLangID(L_CPP);
|
||||
|
||||
if (langType != L_RC)
|
||||
{
|
||||
@ -967,7 +970,7 @@ void ScintillaEditView::setJsLexer()
|
||||
{
|
||||
const TCHAR *doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
|
||||
|
||||
setLexerFromID(SCLEX_CPP);
|
||||
setLexerFromLangID(L_JAVASCRIPT);
|
||||
const TCHAR *pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
|
||||
makeStyle(L_JAVASCRIPT, pKwArray);
|
||||
|
||||
@ -978,7 +981,7 @@ void ScintillaEditView::setJsLexer()
|
||||
execute(SCI_SETKEYWORDS, 2, reinterpret_cast<LPARAM>(doxygenKeyWords_char));
|
||||
}
|
||||
|
||||
const TCHAR *newLexerName = ScintillaEditView::langNames[L_JAVASCRIPT].lexerName;
|
||||
const TCHAR *newLexerName = ScintillaEditView::_langNameInfoArray[L_JAVASCRIPT]._langName;
|
||||
LexerStyler *pNewStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(newLexerName);
|
||||
if (pNewStyler) // New js styler is available, so we can use it do more modern styling
|
||||
{
|
||||
@ -1018,7 +1021,7 @@ void ScintillaEditView::setJsLexer()
|
||||
}
|
||||
else // New js styler is not available, we use the old styling for the sake of retro-compatibility
|
||||
{
|
||||
const TCHAR *lexerName = ScintillaEditView::langNames[L_JS].lexerName;
|
||||
const TCHAR *lexerName = ScintillaEditView::_langNameInfoArray[L_JS]._langName;
|
||||
LexerStyler *pOldStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(lexerName);
|
||||
|
||||
if (pOldStyler)
|
||||
@ -1081,7 +1084,7 @@ void ScintillaEditView::setTclLexer()
|
||||
const char *tclTypes;
|
||||
|
||||
|
||||
setLexerFromID(SCLEX_TCL);
|
||||
setLexerFromLangID(L_TCL);
|
||||
|
||||
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
|
||||
makeStyle(L_TCL, pKwArray);
|
||||
@ -1108,7 +1111,7 @@ void ScintillaEditView::setTclLexer()
|
||||
|
||||
void ScintillaEditView::setObjCLexer(LangType langType)
|
||||
{
|
||||
setLexerFromID(SCLEX_OBJC);
|
||||
setLexerFromLangID(L_OBJC);
|
||||
|
||||
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
|
||||
|
||||
@ -1170,7 +1173,7 @@ void ScintillaEditView::setObjCLexer(LangType langType)
|
||||
void ScintillaEditView::setTypeScriptLexer()
|
||||
{
|
||||
const TCHAR* doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
|
||||
setLexerFromID(SCLEX_CPP);
|
||||
setLexerFromLangID(L_TYPESCRIPT);
|
||||
|
||||
if (doxygenKeyWords)
|
||||
{
|
||||
@ -1219,9 +1222,9 @@ void ScintillaEditView::setKeywords(LangType langType, const char *keywords, int
|
||||
execute(SCI_SETKEYWORDS, index, reinterpret_cast<LPARAM>(getCompleteKeywordList(wordList, langType, index)));
|
||||
}
|
||||
|
||||
void ScintillaEditView::setLexer(int lexerID, LangType langType, int whichList)
|
||||
void ScintillaEditView::setLexer(LangType langType, int whichList)
|
||||
{
|
||||
setLexerFromID(lexerID);
|
||||
setLexerFromLangID(langType);
|
||||
|
||||
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
|
||||
|
||||
@ -1290,7 +1293,7 @@ void ScintillaEditView::setLexer(int lexerID, LangType langType, int whichList)
|
||||
|
||||
void ScintillaEditView::makeStyle(LangType language, const TCHAR **keywordArray)
|
||||
{
|
||||
const TCHAR * lexerName = ScintillaEditView::langNames[language].lexerName;
|
||||
const TCHAR * lexerName = ScintillaEditView::_langNameInfoArray[language]._langName;
|
||||
LexerStyler *pStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(lexerName);
|
||||
if (pStyler)
|
||||
{
|
||||
@ -1712,7 +1715,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
||||
if (typeDoc >= L_EXTERNAL && typeDoc < NppParameters::getInstance().L_END)
|
||||
setExternalLexer(typeDoc);
|
||||
else
|
||||
setLexerFromID((_codepage == CP_CHINESE_TRADITIONAL) ? SCLEX_MAKEFILE : SCLEX_NULL);
|
||||
setLexerFromLangID(L_TEXT);
|
||||
break;
|
||||
|
||||
}
|
||||
@ -1888,15 +1891,13 @@ void ScintillaEditView::styleChange()
|
||||
restyleBuffer();
|
||||
}
|
||||
|
||||
bool ScintillaEditView::setLexerFromID(int lexerID)
|
||||
bool ScintillaEditView::setLexerFromLangID(int langID) // Internal lexer only
|
||||
{
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4996)
|
||||
const char* pName = LexerNameFromID(lexerID); //deprecated, therefore disabled warning
|
||||
#pragma warning( pop )
|
||||
if (!pName)
|
||||
if (langID >= L_EXTERNAL)
|
||||
return false;
|
||||
execute(SCI_SETILEXER, 0, reinterpret_cast<LPARAM>(CreateLexer(pName)));
|
||||
|
||||
const char* lexerNameID = _langNameInfoArray[langID]._lexerID;
|
||||
execute(SCI_SETILEXER, 0, reinterpret_cast<LPARAM>(CreateLexer(lexerNameID)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -169,12 +169,12 @@ struct SortInPositionOrder {
|
||||
|
||||
typedef std::vector<ColumnModeInfo> ColumnModeInfos;
|
||||
|
||||
struct LanguageName {
|
||||
const TCHAR * lexerName = nullptr;
|
||||
const TCHAR * shortName = nullptr;
|
||||
const TCHAR * longName = nullptr;
|
||||
LangType LangID = L_TEXT;
|
||||
int lexerID = 0;
|
||||
struct LanguageNameInfo {
|
||||
const TCHAR* _langName = nullptr;
|
||||
const TCHAR* _shortName = nullptr;
|
||||
const TCHAR* _longName = nullptr;
|
||||
LangType _langID = L_TEXT;
|
||||
const char* _lexerID = nullptr;
|
||||
};
|
||||
|
||||
#define URL_INDIC 8
|
||||
@ -541,7 +541,7 @@ public:
|
||||
|
||||
bool getIndicatorRange(size_t indicatorNumber, size_t* from = NULL, size_t* to = NULL, size_t* cur = NULL);
|
||||
|
||||
static LanguageName langNames[L_EXTERNAL+1];
|
||||
static LanguageNameInfo _langNameInfoArray[L_EXTERNAL+1];
|
||||
|
||||
void bufferUpdated(Buffer * buffer, int mask);
|
||||
BufferID getCurrentBufferID() { return _currentBufferID; };
|
||||
@ -649,8 +649,8 @@ protected:
|
||||
void restyleBuffer();
|
||||
const char * getCompleteKeywordList(std::basic_string<char> & kwl, LangType langType, int keywordIndex);
|
||||
void setKeywords(LangType langType, const char *keywords, int index);
|
||||
void setLexer(int lexerID, LangType langType, int whichList);
|
||||
bool setLexerFromID(int lexerID);
|
||||
void setLexer(LangType langID, int whichList);
|
||||
bool setLexerFromLangID(int langID);
|
||||
void makeStyle(LangType langType, const TCHAR **keywordArray = NULL);
|
||||
void setStyle(Style styleToSet); //NOT by reference (style edited)
|
||||
void setSpecialStyle(const Style & styleToSet); //by reference
|
||||
@ -674,176 +674,176 @@ protected:
|
||||
|
||||
//Simple lexers
|
||||
void setCssLexer() {
|
||||
setLexer(SCLEX_CSS, L_CSS, LIST_0 | LIST_1 | LIST_4 | LIST_6);
|
||||
setLexer(L_CSS, LIST_0 | LIST_1 | LIST_4 | LIST_6);
|
||||
};
|
||||
|
||||
void setLuaLexer() {
|
||||
setLexer(SCLEX_LUA, L_LUA, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_LUA, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
};
|
||||
|
||||
void setMakefileLexer() {
|
||||
setLexer(SCLEX_MAKEFILE, L_MAKEFILE, LIST_NONE);
|
||||
setLexer(L_MAKEFILE, LIST_NONE);
|
||||
};
|
||||
|
||||
void setIniLexer() {
|
||||
setLexer(SCLEX_PROPERTIES, L_INI, LIST_NONE);
|
||||
setLexer(L_INI, LIST_NONE);
|
||||
execute(SCI_STYLESETEOLFILLED, SCE_PROPS_SECTION, true);
|
||||
};
|
||||
|
||||
|
||||
void setSqlLexer() {
|
||||
const bool kbBackSlash = NppParameters::getInstance().getNppGUI()._backSlashIsEscapeCharacterForSql;
|
||||
setLexer(SCLEX_SQL, L_SQL, LIST_0 | LIST_1 | LIST_4);
|
||||
setLexer(L_SQL, LIST_0 | LIST_1 | LIST_4);
|
||||
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("sql.backslash.escapes"), reinterpret_cast<LPARAM>(kbBackSlash ? "1" : "0"));
|
||||
};
|
||||
|
||||
void setBashLexer() {
|
||||
setLexer(SCLEX_BASH, L_BASH, LIST_0);
|
||||
setLexer(L_BASH, LIST_0);
|
||||
};
|
||||
|
||||
void setVBLexer() {
|
||||
setLexer(SCLEX_VB, L_VB, LIST_0);
|
||||
setLexer(L_VB, LIST_0);
|
||||
};
|
||||
|
||||
void setPascalLexer() {
|
||||
setLexer(SCLEX_PASCAL, L_PASCAL, LIST_0);
|
||||
setLexer(L_PASCAL, LIST_0);
|
||||
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.preprocessor"), reinterpret_cast<LPARAM>("1"));
|
||||
};
|
||||
|
||||
void setPerlLexer() {
|
||||
setLexer(SCLEX_PERL, L_PERL, LIST_0);
|
||||
setLexer(L_PERL, LIST_0);
|
||||
};
|
||||
|
||||
void setPythonLexer() {
|
||||
setLexer(SCLEX_PYTHON, L_PYTHON, LIST_0 | LIST_1);
|
||||
setLexer(L_PYTHON, LIST_0 | LIST_1);
|
||||
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.quotes.python"), reinterpret_cast<LPARAM>("1"));
|
||||
};
|
||||
|
||||
void setBatchLexer() {
|
||||
setLexer(SCLEX_BATCH, L_BATCH, LIST_0);
|
||||
setLexer(L_BATCH, LIST_0);
|
||||
};
|
||||
|
||||
void setTeXLexer() {
|
||||
for (int i = 0 ; i < 4 ; ++i)
|
||||
execute(SCI_SETKEYWORDS, i, reinterpret_cast<LPARAM>(TEXT("")));
|
||||
setLexer(SCLEX_TEX, L_TEX, LIST_NONE);
|
||||
setLexer(L_TEX, LIST_NONE);
|
||||
};
|
||||
|
||||
void setNsisLexer() {
|
||||
setLexer(SCLEX_NSIS, L_NSIS, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_NSIS, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
};
|
||||
|
||||
void setFortranLexer() {
|
||||
setLexer(SCLEX_FORTRAN, L_FORTRAN, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_FORTRAN, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setFortran77Lexer() {
|
||||
setLexer(SCLEX_F77, L_FORTRAN_77, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_FORTRAN_77, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setLispLexer(){
|
||||
setLexer(SCLEX_LISP, L_LISP, LIST_0 | LIST_1);
|
||||
setLexer(L_LISP, LIST_0 | LIST_1);
|
||||
};
|
||||
|
||||
void setSchemeLexer(){
|
||||
setLexer(SCLEX_LISP, L_SCHEME, LIST_0 | LIST_1);
|
||||
setLexer(L_SCHEME, LIST_0 | LIST_1);
|
||||
};
|
||||
|
||||
void setAsmLexer(){
|
||||
setLexer(SCLEX_ASM, L_ASM, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
setLexer(L_ASM, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
};
|
||||
|
||||
void setDiffLexer(){
|
||||
setLexer(SCLEX_DIFF, L_DIFF, LIST_NONE);
|
||||
setLexer(L_DIFF, LIST_NONE);
|
||||
};
|
||||
|
||||
void setPropsLexer(){
|
||||
setLexer(SCLEX_PROPERTIES, L_PROPS, LIST_NONE);
|
||||
setLexer(L_PROPS, LIST_NONE);
|
||||
};
|
||||
|
||||
void setPostscriptLexer(){
|
||||
setLexer(SCLEX_PS, L_PS, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_PS, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
};
|
||||
|
||||
void setRubyLexer(){
|
||||
setLexer(SCLEX_RUBY, L_RUBY, LIST_0);
|
||||
setLexer(L_RUBY, LIST_0);
|
||||
execute(SCI_STYLESETEOLFILLED, SCE_RB_POD, true);
|
||||
};
|
||||
|
||||
void setSmalltalkLexer(){
|
||||
setLexer(SCLEX_SMALLTALK, L_SMALLTALK, LIST_0);
|
||||
setLexer(L_SMALLTALK, LIST_0);
|
||||
};
|
||||
|
||||
void setVhdlLexer(){
|
||||
setLexer(SCLEX_VHDL, L_VHDL, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
|
||||
setLexer(L_VHDL, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
|
||||
};
|
||||
|
||||
void setKixLexer(){
|
||||
setLexer(SCLEX_KIX, L_KIX, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_KIX, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setAutoItLexer(){
|
||||
setLexer(SCLEX_AU3, L_AU3, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
|
||||
setLexer(L_AU3, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
|
||||
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.preprocessor"), reinterpret_cast<LPARAM>("1"));
|
||||
};
|
||||
|
||||
void setCamlLexer(){
|
||||
setLexer(SCLEX_CAML, L_CAML, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_CAML, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setAdaLexer(){
|
||||
setLexer(SCLEX_ADA, L_ADA, LIST_0);
|
||||
setLexer(L_ADA, LIST_0);
|
||||
};
|
||||
|
||||
void setVerilogLexer(){
|
||||
setLexer(SCLEX_VERILOG, L_VERILOG, LIST_0 | LIST_1);
|
||||
setLexer(L_VERILOG, LIST_0 | LIST_1);
|
||||
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.preprocessor"), reinterpret_cast<LPARAM>("1"));
|
||||
};
|
||||
|
||||
void setMatlabLexer(){
|
||||
setLexer(SCLEX_MATLAB, L_MATLAB, LIST_0);
|
||||
setLexer(L_MATLAB, LIST_0);
|
||||
};
|
||||
|
||||
void setHaskellLexer(){
|
||||
setLexer(SCLEX_HASKELL, L_HASKELL, LIST_0);
|
||||
setLexer(L_HASKELL, LIST_0);
|
||||
};
|
||||
|
||||
void setInnoLexer() {
|
||||
setLexer(SCLEX_INNOSETUP, L_INNO, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
setLexer(L_INNO, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
};
|
||||
|
||||
void setCmakeLexer() {
|
||||
setLexer(SCLEX_CMAKE, L_CMAKE, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_CMAKE, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setYamlLexer() {
|
||||
setLexer(SCLEX_YAML, L_YAML, LIST_0);
|
||||
setLexer(L_YAML, LIST_0);
|
||||
};
|
||||
|
||||
//--------------------
|
||||
|
||||
void setCobolLexer() {
|
||||
setLexer(SCLEX_COBOL, L_COBOL, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(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);
|
||||
setLexer(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);
|
||||
setLexer(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 | LIST_5);
|
||||
setLexer(L_POWERSHELL, LIST_0 | LIST_1 | LIST_2 | LIST_5);
|
||||
};
|
||||
void setRLexer() {
|
||||
setLexer(SCLEX_R, L_R, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_R, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setCoffeeScriptLexer() {
|
||||
setLexer(SCLEX_COFFEESCRIPT, L_COFFEESCRIPT, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_COFFEESCRIPT, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
};
|
||||
|
||||
void setBaanCLexer() {
|
||||
setLexer(SCLEX_BAAN, L_BAANC, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6 | LIST_7 | LIST_8);
|
||||
setLexer(L_BAANC, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6 | LIST_7 | LIST_8);
|
||||
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("lexer.baan.styling.within.preprocessor"), reinterpret_cast<LPARAM>("1"));
|
||||
execute(SCI_SETWORDCHARS, 0, reinterpret_cast<LPARAM>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:"));
|
||||
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.preprocessor"), reinterpret_cast<LPARAM>("1"));
|
||||
@ -855,102 +855,102 @@ protected:
|
||||
};
|
||||
|
||||
void setSrecLexer() {
|
||||
setLexer(SCLEX_SREC, L_SREC, LIST_NONE);
|
||||
setLexer(L_SREC, LIST_NONE);
|
||||
};
|
||||
|
||||
void setIHexLexer() {
|
||||
setLexer(SCLEX_IHEX, L_IHEX, LIST_NONE);
|
||||
setLexer(L_IHEX, LIST_NONE);
|
||||
};
|
||||
|
||||
void setTEHexLexer() {
|
||||
setLexer(SCLEX_TEHEX, L_TEHEX, LIST_NONE);
|
||||
setLexer(L_TEHEX, LIST_NONE);
|
||||
};
|
||||
|
||||
void setAsn1Lexer() {
|
||||
setLexer(SCLEX_ASN1, L_ASN1, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_ASN1, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
};
|
||||
|
||||
void setAVSLexer() {
|
||||
setLexer(SCLEX_AVS, L_AVS, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
setLexer(L_AVS, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
execute(SCI_SETWORDCHARS, 0, reinterpret_cast<LPARAM>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_#"));
|
||||
};
|
||||
|
||||
void setBlitzBasicLexer() {
|
||||
setLexer(SCLEX_BLITZBASIC, L_BLITZBASIC, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_BLITZBASIC, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
};
|
||||
|
||||
void setPureBasicLexer() {
|
||||
setLexer(SCLEX_PUREBASIC, L_PUREBASIC, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_PUREBASIC, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
};
|
||||
|
||||
void setFreeBasicLexer() {
|
||||
setLexer(SCLEX_FREEBASIC, L_FREEBASIC, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_FREEBASIC, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
};
|
||||
|
||||
void setCsoundLexer() {
|
||||
setLexer(SCLEX_CSOUND, L_CSOUND, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_CSOUND, LIST_0 | LIST_1 | LIST_2);
|
||||
execute(SCI_STYLESETEOLFILLED, SCE_CSOUND_STRINGEOL, true);
|
||||
};
|
||||
|
||||
void setErlangLexer() {
|
||||
setLexer(SCLEX_ERLANG, L_ERLANG, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
setLexer(L_ERLANG, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
};
|
||||
|
||||
void setESCRIPTLexer() {
|
||||
setLexer(SCLEX_ESCRIPT, L_ESCRIPT, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_ESCRIPT, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setForthLexer() {
|
||||
setLexer(SCLEX_FORTH, L_FORTH, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
setLexer(L_FORTH, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
execute(SCI_SETWORDCHARS, 0, reinterpret_cast<LPARAM>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%-"));
|
||||
};
|
||||
|
||||
void setLatexLexer() {
|
||||
setLexer(SCLEX_LATEX, L_LATEX, LIST_NONE);
|
||||
setLexer(L_LATEX, LIST_NONE);
|
||||
};
|
||||
|
||||
void setMMIXALLexer() {
|
||||
setLexer(SCLEX_MMIXAL, L_MMIXAL, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_MMIXAL, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setNimrodLexer() {
|
||||
setLexer(SCLEX_NIMROD, L_NIM, LIST_0);
|
||||
setLexer(L_NIM, LIST_0);
|
||||
};
|
||||
|
||||
void setNncrontabLexer() {
|
||||
setLexer(SCLEX_NNCRONTAB, L_NNCRONTAB, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_NNCRONTAB, LIST_0 | LIST_1 | LIST_2);
|
||||
execute(SCI_SETWORDCHARS, 0, reinterpret_cast<LPARAM>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%-"));
|
||||
};
|
||||
|
||||
void setOScriptLexer() {
|
||||
setLexer(SCLEX_OSCRIPT, L_OSCRIPT, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
setLexer(L_OSCRIPT, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5);
|
||||
execute(SCI_SETWORDCHARS, 0, reinterpret_cast<LPARAM>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$"));
|
||||
};
|
||||
|
||||
void setREBOLLexer() {
|
||||
setLexer(SCLEX_REBOL, L_REBOL, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
|
||||
setLexer(L_REBOL, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
|
||||
execute(SCI_SETWORDCHARS, 0, reinterpret_cast<LPARAM>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?!.’+-*&|=_~"));
|
||||
};
|
||||
|
||||
void setRegistryLexer() {
|
||||
setLexer(SCLEX_REGISTRY, L_REGISTRY, LIST_NONE);
|
||||
setLexer(L_REGISTRY, LIST_NONE);
|
||||
};
|
||||
|
||||
void setRustLexer() {
|
||||
setLexer(SCLEX_RUST, L_RUST, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
|
||||
setLexer(L_RUST, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6);
|
||||
execute(SCI_SETWORDCHARS, 0, reinterpret_cast<LPARAM>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_#"));
|
||||
};
|
||||
|
||||
void setSpiceLexer() {
|
||||
setLexer(SCLEX_SPICE, L_SPICE, LIST_0 | LIST_1 | LIST_2);
|
||||
setLexer(L_SPICE, LIST_0 | LIST_1 | LIST_2);
|
||||
};
|
||||
|
||||
void setTxt2tagsLexer() {
|
||||
setLexer(SCLEX_TXT2TAGS, L_TXT2TAGS, LIST_NONE);
|
||||
setLexer(L_TXT2TAGS, LIST_NONE);
|
||||
};
|
||||
|
||||
void setVisualPrologLexer() {
|
||||
setLexer(SCLEX_VISUALPROLOG, L_VISUALPROLOG, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
setLexer(L_VISUALPROLOG, LIST_0 | LIST_1 | LIST_2 | LIST_3);
|
||||
}
|
||||
|
||||
//--------------------
|
||||
@ -958,7 +958,7 @@ protected:
|
||||
void setSearchResultLexer() {
|
||||
execute(SCI_STYLESETEOLFILLED, SCE_SEARCHRESULT_FILE_HEADER, true);
|
||||
execute(SCI_STYLESETEOLFILLED, SCE_SEARCHRESULT_SEARCH_HEADER, true);
|
||||
setLexer(SCLEX_SEARCHRESULT, L_SEARCHRESULT, LIST_NONE);
|
||||
setLexer(L_SEARCHRESULT, LIST_NONE);
|
||||
};
|
||||
|
||||
bool isNeededFolderMarge(LangType typeDoc) const {
|
||||
|
@ -160,7 +160,7 @@ bool FunctionParsersManager::loadFuncListFromXmlTree(generic_string & xmlDirPath
|
||||
index = lType;
|
||||
if (overrideId.empty())
|
||||
{
|
||||
generic_string lexerName = ScintillaEditView::langNames[lType].lexerName;
|
||||
generic_string lexerName = ScintillaEditView::_langNameInfoArray[lType]._langName;
|
||||
funcListRulePath += lexerName;
|
||||
funcListRulePath += TEXT(".xml");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user