diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index d17ef2fbc..fe100ce67 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4907,13 +4907,6 @@ bool Notepad_plus::activateBuffer(BufferID id, int whichOne, bool forceApplyHili notifyBufferActivated(id, whichOne); - bool isCurrBuffDetection = (nppGui._fileAutoDetection & cdEnabledNew) ? true : false; - if (!reload && isCurrBuffDetection) - { - // Buffer has been activated, now check for file modification - // If enabled for current buffer - pBuf->checkFileState(); - } return true; } @@ -6664,6 +6657,16 @@ void Notepad_plus::notifyBufferActivated(BufferID bufid, int view) _pFuncList->reload(); } + NppGUI& nppGui = NppParameters::getInstance().getNppGUI(); + bool isCurrBuffDetection = (nppGui._fileAutoDetection & cdEnabledNew) ? true : false; + bool reload = buf->getNeedReload(); + if (!reload && isCurrBuffDetection) + { + // Buffer has been activated, now check for file modification + // If enabled for current buffer + buf->checkFileState(); + } + _linkTriggered = true; }