Add a ‘did change content’ notification to document_t

This is only meant for when the document reloads content because the file was changed on disk. Long-term though, I think reloading document because of disk changes should be handled at a higher level.
This commit is contained in:
Allan Odgaard
2014-04-11 20:45:16 +07:00
parent f445f19287
commit 375893fc7f
2 changed files with 3 additions and 0 deletions

View File

@@ -1069,6 +1069,7 @@ namespace document
_document->check_modified(_document->_buffer->revision(), _document->_buffer->revision());
_document->mark_pristine();
_document->undo_manager().end_undo_group(ng::ranges_t(0));
_document->broadcast(callback_t::did_change_content);
}
else
{
@@ -1081,6 +1082,7 @@ namespace document
_document->_buffer->replace(0, _document->_buffer->size(), merged);
_document->set_revision(_document->_buffer->bump_revision());
_document->undo_manager().end_undo_group(ng::ranges_t(0));
_document->broadcast(callback_t::did_change_content);
// TODO if there was a conflict, we shouldnt take the merged content (but ask user what to do)
// TODO mark_pristine() but using yours
}

View File

@@ -143,6 +143,7 @@ namespace document
// did_change_display_name,
did_change_marks,
// did_change_symbols,
did_change_content,
};
virtual ~callback_t () { }