[NEW_FEATURE] Add the smart highlight file size limit - 1.5 MB in order to improve the performance.
Make setInfo() call before getFuncsArray() call for PluginsManager. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@224 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
a7d7d28f98
commit
536a07167d
@ -82,6 +82,8 @@ bool PluginsManager::loadPlugins(const char *dir)
|
|||||||
if (!pi->_pMessageProc)
|
if (!pi->_pMessageProc)
|
||||||
throw string("Missing \"messageProc\" function");
|
throw string("Missing \"messageProc\" function");
|
||||||
|
|
||||||
|
pi->_pFuncSetInfo(_nppData);
|
||||||
|
|
||||||
pi->_pFuncGetFuncsArray = (PFUNCGETFUNCSARRAY)GetProcAddress(pi->_hLib, "getFuncsArray");
|
pi->_pFuncGetFuncsArray = (PFUNCGETFUNCSARRAY)GetProcAddress(pi->_hLib, "getFuncsArray");
|
||||||
if (!pi->_pFuncGetFuncsArray)
|
if (!pi->_pFuncGetFuncsArray)
|
||||||
throw string("Missing \"getFuncsArray\" function");
|
throw string("Missing \"getFuncsArray\" function");
|
||||||
@ -90,16 +92,9 @@ bool PluginsManager::loadPlugins(const char *dir)
|
|||||||
|
|
||||||
if ((!pi->_funcItems) || (pi->_nbFuncItem <= 0))
|
if ((!pi->_funcItems) || (pi->_nbFuncItem <= 0))
|
||||||
throw string("Missing \"FuncItems\" array, or the nb of Function Item is not set correctly");
|
throw string("Missing \"FuncItems\" array, or the nb of Function Item is not set correctly");
|
||||||
/*
|
|
||||||
for (int c = 0 ; c < pi->_nbFuncItem ; c++)
|
|
||||||
if (!pi->_funcItems[c]._pFunc)
|
|
||||||
throw string("\"FuncItems\" array is not set correctly");
|
|
||||||
*/
|
|
||||||
pi->_pluginMenu = ::CreateMenu();
|
pi->_pluginMenu = ::CreateMenu();
|
||||||
|
|
||||||
pi->_pFuncSetInfo(_nppData);
|
|
||||||
|
|
||||||
|
|
||||||
GetLexerCountFn GetLexerCount = (GetLexerCountFn)::GetProcAddress(pi->_hLib, "GetLexerCount");
|
GetLexerCountFn GetLexerCount = (GetLexerCountFn)::GetProcAddress(pi->_hLib, "GetLexerCount");
|
||||||
// it's a lexer plugin
|
// it's a lexer plugin
|
||||||
if (GetLexerCount)
|
if (GetLexerCount)
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
const char Notepad_plus::_className[32] = NOTEPAD_PP_CLASS_NAME;
|
const char Notepad_plus::_className[32] = NOTEPAD_PP_CLASS_NAME;
|
||||||
const char *urlHttpRegExpr = "http://[a-z0-9_\\-\\+.:?&@=/%#]*";
|
const char *urlHttpRegExpr = "http://[a-z0-9_\\-\\+.:?&@=/%#]*";
|
||||||
|
|
||||||
|
const int smartHighlightFileSizeLimit = 1024 * 1024 + 512 * 1024; // 1,5 MB
|
||||||
|
|
||||||
int docTabIconIDs[] = {IDI_SAVED_ICON, IDI_UNSAVED_ICON, IDI_READONLY_ICON};
|
int docTabIconIDs[] = {IDI_SAVED_ICON, IDI_UNSAVED_ICON, IDI_READONLY_ICON};
|
||||||
enum tb_stat {tb_saved, tb_unsaved, tb_ro};
|
enum tb_stat {tb_saved, tb_unsaved, tb_ro};
|
||||||
|
|
||||||
@ -7692,6 +7694,10 @@ void Notepad_plus::markSelectedText()
|
|||||||
if (!nppGUI._enableSmartHilite)
|
if (!nppGUI._enableSmartHilite)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (_pEditView->getCurrentDocLen() > smartHighlightFileSizeLimit)
|
||||||
|
return;
|
||||||
|
|
||||||
//Get selection
|
//Get selection
|
||||||
CharacterRange range = _pEditView->getSelection();
|
CharacterRange range = _pEditView->getSelection();
|
||||||
//Dont mark if the selection has not changed.
|
//Dont mark if the selection has not changed.
|
||||||
|
Loading…
Reference in New Issue
Block a user