mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
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:
@@ -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 shouldn’t take the merged content (but ask user what to do)
|
||||
// TODO mark_pristine() but using ‘yours’
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ namespace document
|
||||
// did_change_display_name,
|
||||
did_change_marks,
|
||||
// did_change_symbols,
|
||||
did_change_content,
|
||||
};
|
||||
|
||||
virtual ~callback_t () { }
|
||||
|
||||
Reference in New Issue
Block a user