]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Account for old versions of Pygments
[lyx.git] / src / Buffer.cpp
index 2e22770f5c69ca9b3de301e93181b6140154b089..61b89200c17a7b784205965985077d02fdb2e9a6 100644 (file)
@@ -380,10 +380,7 @@ public:
        void refreshFileMonitor();
 
        /// Notify or clear of external modification
-       void fileExternallyModified(bool exists) const;
-
-       /// Block notifications of external modifications
-       FileMonitorBlocker blockFileMonitor() { return file_monitor_->block(); }
+       void fileExternallyModified(bool exists);
 
        /// has been externally modified? Can be reset by the user.
        mutable bool externally_modified_;
@@ -1379,7 +1376,6 @@ FileName Buffer::getBackupName() const {
 // Should probably be moved to somewhere else: BufferView? GuiView?
 bool Buffer::save() const
 {
-       FileMonitorBlocker block = d->blockFileMonitor();
        docstring const file = makeDisplayPath(absFileName(), 20);
        d->filename.refresh();
 
@@ -5336,10 +5332,9 @@ void Buffer::Impl::refreshFileMonitor()
 }
 
 
-void Buffer::Impl::fileExternallyModified(bool const exists) const
+void Buffer::Impl::fileExternallyModified(bool const exists)
 {
-       // prevent false positives, because FileMonitorBlocker is not enough on
-       // OSX.
+       // ignore notifications after our own saving operations
        if (checksum_ == filename.checksum()) {
                LYXERR(Debug::FILES, "External modification but "
                       "checksum unchanged: " << filename);
@@ -5351,8 +5346,13 @@ void Buffer::Impl::fileExternallyModified(bool const exists) const
        // location, then the externally modified warning will appear then.
        if (exists)
                        externally_modified_ = true;
-       if (wa_)
+       // Update external modification notification.
+       // Dirty buffers must be visible at all times.
+       if (wa_ && wa_->unhide(owner_))
                wa_->updateTitles();
+       else
+               // Unable to unhide the buffer (e.g. no GUI or not current View)
+               lyx_clean = true;
 }