Thanks for working through this with me.
Git correctly sees the changes made in VS. I'm using CTRL-S for saving.
All of my code is on an external hard drive, I don't think that should make a difference but I thought I would mention it.
void FileMonitor::ProcessChangeNotification( FileSystemUtils::Path& file )
{
// Notify any listeners and add to change list if this is a watched file/dir
// Again - this isn't correct, just a hack
bool bPathIsDir = !file.HasExtension();
FileSystemUtils::Path pathDir = bPathIsDir ? file : file.ParentPath();
TDirList::iterator dirIt = GetWatchedDirEntry(pathDir);
if (dirIt != m_DirWatchList.end())
{
// Is directory itself being watched?
// Unsure here - no need to notify as folder will get it's own notification come through?
// Bit below feels redundant
if (dirIt->bWatchDirItself)
{
if (dirIt->pListener != NULL)
{
dirIt->pListener->OnFileChange(pathDir);
}
else
{
m_FileChangedList.push_back(pathDir);
m_bChangeFlag = true;
}
}
// Handle MSVC2013 strange write behavior
auto pos = file.m_string.find("~");
if (pos != file.m_string.npos)
{
file.m_string = file.m_string.substr(0, pos);
}
// Is this one of the files being watched in the directory?
TFileList::iterator fileIt = GetWatchedFileEntry(file, dirIt->fileWatchList);
if (fileIt != dirIt->fileWatchList.end())
{
if (fileIt->pListener != NULL)
{
fileIt->pListener->OnFileChange(file);
}
else
{
m_FileChangedList.push_back(file);
m_bChangeFlag = true;
}
}
}
}