mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Fix FuncList not refresh correctly due to large files perf improving
Fix #16221 completely
This commit is contained in:
parent
829cd9d119
commit
8793825b34
@ -6702,14 +6702,6 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & (BufferChangeLanguage))
|
|
||||||
{
|
|
||||||
if (mainActive)
|
|
||||||
_autoCompleteMain.setLanguage(buffer->getLangType());
|
|
||||||
if (subActive)
|
|
||||||
_autoCompleteSub.setLanguage(buffer->getLangType());
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((currentView() == MAIN_VIEW) && !mainActive)
|
if ((currentView() == MAIN_VIEW) && !mainActive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -6732,9 +6724,9 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
|
|||||||
{
|
{
|
||||||
checkLangsMenu(-1); //let Notepad++ do search for the item
|
checkLangsMenu(-1); //let Notepad++ do search for the item
|
||||||
setLangStatus(buffer->getLangType());
|
setLangStatus(buffer->getLangType());
|
||||||
if (_mainEditView.getCurrentBuffer() == buffer)
|
if (mainActive)
|
||||||
_autoCompleteMain.setLanguage(buffer->getLangType());
|
_autoCompleteMain.setLanguage(buffer->getLangType());
|
||||||
else if (_subEditView.getCurrentBuffer() == buffer)
|
else if (subActive)
|
||||||
_autoCompleteSub.setLanguage(buffer->getLangType());
|
_autoCompleteSub.setLanguage(buffer->getLangType());
|
||||||
|
|
||||||
if (_pFuncList && (!_pFuncList->isClosed()) && _pFuncList->isVisible())
|
if (_pFuncList && (!_pFuncList->isClosed()) && _pFuncList->isVisible())
|
||||||
|
@ -4135,6 +4135,15 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NPPM_INTERNAL_RELOADFUNCTIONLIST:
|
||||||
|
{
|
||||||
|
if (_pFuncList && (!_pFuncList->isClosed()) && _pFuncList->isVisible())
|
||||||
|
{
|
||||||
|
_pFuncList->reload();
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (message == WDN_NOTIFY)
|
if (message == WDN_NOTIFY)
|
||||||
|
@ -1723,6 +1723,10 @@ void ScintillaEditView::setLanguage(LangType langType)
|
|||||||
|
|
||||||
if (_currentBuffer->getLastLangType() > 0 && !_currentBuffer->isUntitled())
|
if (_currentBuffer->getLastLangType() > 0 && !_currentBuffer->isUntitled())
|
||||||
{
|
{
|
||||||
|
// To improve switching lexer performance, here's the tip:
|
||||||
|
// 1. Set current document to a blank document
|
||||||
|
// 2. Set a new lexer
|
||||||
|
// 3. Reset back to the current document
|
||||||
saveCurrentPos();
|
saveCurrentPos();
|
||||||
Document prev = execute(SCI_GETDOCPOINTER);
|
Document prev = execute(SCI_GETDOCPOINTER);
|
||||||
execute(SCI_SETMODEVENTMASK, MODEVENTMASK_OFF);
|
execute(SCI_SETMODEVENTMASK, MODEVENTMASK_OFF);
|
||||||
@ -1738,6 +1742,11 @@ void ScintillaEditView::setLanguage(LangType langType)
|
|||||||
maintainStateForNpc();
|
maintainStateForNpc();
|
||||||
setCRLF();
|
setCRLF();
|
||||||
restoreCurrentPosPreStep();
|
restoreCurrentPosPreStep();
|
||||||
|
|
||||||
|
// When buffer sets lang type ("_currentBuffer->setLangType(langType);"), it'll call doNotify(BufferChangeLanguage | BufferChangeLexing),
|
||||||
|
// then FunctionList will be reloaded. However, it'll be reloaded on the blank document.
|
||||||
|
// That's why here we do again FunctionList reload, after the current document be reset back.
|
||||||
|
::SendMessage(_hParent, NPPM_INTERNAL_RELOADFUNCTIONLIST, 0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -745,6 +745,7 @@
|
|||||||
#define NPPM_INTERNAL_LWINDENT (NOTEPADPLUS_USER_INTERNAL + 105)
|
#define NPPM_INTERNAL_LWINDENT (NOTEPADPLUS_USER_INTERNAL + 105)
|
||||||
#define NPPM_INTERNAL_CHECKDOCSTATUS (NOTEPADPLUS_USER_INTERNAL + 106)
|
#define NPPM_INTERNAL_CHECKDOCSTATUS (NOTEPADPLUS_USER_INTERNAL + 106)
|
||||||
#define NPPM_INTERNAL_HIDEMENURIGHTSHORTCUTS (NOTEPADPLUS_USER_INTERNAL + 107)
|
#define NPPM_INTERNAL_HIDEMENURIGHTSHORTCUTS (NOTEPADPLUS_USER_INTERNAL + 107)
|
||||||
|
#define NPPM_INTERNAL_RELOADFUNCTIONLIST (NOTEPADPLUS_USER_INTERNAL + 108)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user