mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Add a “document will delete” callback function
This commit is contained in:
@@ -601,6 +601,7 @@ namespace document
|
||||
document_t::~document_t ()
|
||||
{
|
||||
D(DBF_Document, bug("%s\n", display_name().c_str()););
|
||||
_callbacks(&callback_t::document_will_delete, this);
|
||||
documents.remove(_identifier);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +136,7 @@ namespace document
|
||||
|
||||
virtual ~callback_t () { }
|
||||
virtual void handle_document_event (document_ptr document, event_t event) = 0;
|
||||
virtual void document_will_delete (document_t* document) { }
|
||||
};
|
||||
|
||||
void add_callback (callback_t* callback) { _callbacks.add(callback); }
|
||||
|
||||
Reference in New Issue
Block a user