Fixed crash due to "File status auto-detection" enhancement

Close #5438
This commit is contained in:
Rajendra Singh 2019-03-18 23:04:47 +05:30 committed by Don HO
parent 28f87ca6de
commit f7645fe27e
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -3783,20 +3783,20 @@ bool Notepad_plus::activateBuffer(BufferID id, int whichOne)
return false; return false;
} }
bool isCurrBuffDetection = (NppParameters::getInstance()->getNppGUI()._fileAutoDetection & cdEnabledNew) ? true : false;
if (reload) if (reload)
{ {
performPostReload(whichOne); performPostReload(whichOne);
} }
else if(isCurrBuffDetection)
notifyBufferActivated(id, whichOne);
bool isCurrBuffDetection = (NppParameters::getInstance()->getNppGUI()._fileAutoDetection & cdEnabledNew) ? true : false;
if (!reload && isCurrBuffDetection)
{ {
// Buffer has been activated, now check for file modification // Buffer has been activated, now check for file modification
// If enabled for current buffer // If enabled for current buffer
pBuf->checkFileState(); pBuf->checkFileState();
} }
notifyBufferActivated(id, whichOne);
return true; return true;
} }