Fix "Folder as Workspace" not updating regression

This commit is contained in:
Don Ho 2016-09-05 01:48:42 +02:00
parent 6b3e562d6a
commit 000e447cb9
2 changed files with 9 additions and 2 deletions

View File

@ -87,7 +87,14 @@ DWORD WINAPI Notepad_plus::monitorFileOnChange(void * params)
else
{
changes.Pop(dwAction, wstrFilename);
if (lstrcmp(fullFileName, wstrFilename.GetString()) == 0)
generic_string fn = wstrFilename.GetString();
// Fix monitoring files which are under root problem
size_t pos = fn.find(TEXT("\\\\"));
if (pos == 2)
fn.replace(pos, 2, TEXT("\\"));
if (lstrcmp(fullFileName, fn.c_str()) == 0)
{
if (dwAction == FILE_ACTION_MODIFIED)
{

View File

@ -149,7 +149,7 @@ void CReadChangesRequest::ProcessNotification()
CStringW wstrFilename(fni.FileName, fni.FileNameLength/sizeof(wchar_t));
// Handle a trailing backslash, such as for a root directory.
if (m_wstrDirectory.Right(1) != L"\\")
if (wstrFilename.Right(1) != L"\\")
wstrFilename = m_wstrDirectory + L"\\" + wstrFilename;
else
wstrFilename = m_wstrDirectory + wstrFilename;