Fix Reload dialog displaying issue during File Monitoring

Fix #5586, fix #4847, close #5591
This commit is contained in:
Rajendra Singh 2019-04-27 17:43:58 +05:30 committed by Don HO
parent a86870d8a0
commit ad72f7c36c
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
2 changed files with 8 additions and 1 deletions

View File

@ -5129,6 +5129,10 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
}
case DOC_MODIFIED: //ask for reloading
{
// Since it is being monitored DOC_NEEDRELOAD is going to handle the change.
if (buffer->isMonitoringOn())
break;
bool autoUpdate = (nppGUI._fileAutoDetection & cdAutoUpdate) ? true : false;
if (!autoUpdate || buffer->isDirty())
{

View File

@ -224,7 +224,10 @@ void Buffer::setFileName(const TCHAR *fn, LangType defaultLang)
bool Buffer::checkFileState() // returns true if the status has been changed (it can change into DOC_REGULAR too). false otherwise
{
if (_currentStatus == DOC_UNNAMED) //unsaved document cannot change by environment
// 1. Unsaved document cannot change by environment
// 2. Monitoring is sent by NPPM_INTERNAL_RELOADSCROLLTOEND
// So no need to check file status for both the above cases
if (_currentStatus == DOC_UNNAMED || isMonitoringOn())
return false;
WIN32_FILE_ATTRIBUTE_DATA attributes;