From ad72f7c36c958c7ef7e5c73ae764ae5223c3bae0 Mon Sep 17 00:00:00 2001 From: Rajendra Singh Date: Sat, 27 Apr 2019 17:43:58 +0530 Subject: [PATCH] Fix Reload dialog displaying issue during File Monitoring Fix #5586, fix #4847, close #5591 --- PowerEditor/src/Notepad_plus.cpp | 4 ++++ PowerEditor/src/ScitillaComponent/Buffer.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 271f2f5ae..1c2116de6 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -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()) { diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 8e49eb229..897fdb1aa 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -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;