mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Introduce new callback: callback.document.did-open
Bundle items using this as their semantic class will be executed when the document is first loaded.
This commit is contained in:
@@ -1042,6 +1042,12 @@ namespace
|
||||
// = Document I/O =
|
||||
// ================
|
||||
|
||||
- (void)didOpenDocuemntInTextView:(OakTextView*)textView
|
||||
{
|
||||
for(auto const& item : bundles::query(bundles::kFieldSemanticClass, "callback.document.did-open", [textView scopeContext], bundles::kItemTypeMost, oak::uuid_t(), false))
|
||||
[textView performBundleItem:item];
|
||||
}
|
||||
|
||||
- (void)openAndSelectDocument:(document::document_ptr const&)aDocument
|
||||
{
|
||||
document::document_ptr doc = aDocument;
|
||||
@@ -1050,6 +1056,7 @@ namespace
|
||||
{
|
||||
[self makeTextViewFirstResponder:self];
|
||||
[self setSelectedDocument:doc];
|
||||
[self performSelector:@selector(didOpenDocuemntInTextView:) withObject:self.documentView.textView afterDelay:0];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user