diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 74b4b650b25..f605f33a44c 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -243,8 +243,9 @@ static void addFileInfo(const QString &fileName, IDocument *document, bool isLin watcher = d->linkWatcher(); else watcher = d->fileWatcher(); - if (!watcher->files().contains(fileName)) - watcher->addPath(fileName); + if (watcher->files().contains(fileName)) + watcher->removePath(fileName); + watcher->addPath(fileName); d->m_states[fileName].lastUpdatedState.insert(document, state); }