diff --git a/Applications/TextMate/src/AppController Commands.mm b/Applications/TextMate/src/AppController Commands.mm index 65d252b8..2d15a83f 100644 --- a/Applications/TextMate/src/AppController Commands.mm +++ b/Applications/TextMate/src/AppController Commands.mm @@ -32,12 +32,9 @@ OAK_DEBUG_VAR(AppController_Commands); { // TODO set language according to snippet’s scope selector // TODO mark document as “not modified” - document::document_ptr doc = document::create(); - doc->open(); - ng::editor_ptr editor = ng::editor_for_document(doc); - editor->snippet_dispatch(item->plist(), editor->variables(item->environment(), doc->path_attributes())); - document::show(doc); - doc->close(); + DocumentController* controller = [[DocumentController alloc] init]; + [[controller window] makeKeyAndOrderFront:self]; + [controller performBundleItem:item]; } break; diff --git a/Frameworks/DocumentWindow/src/DocumentCommand.mm b/Frameworks/DocumentWindow/src/DocumentCommand.mm index 1c14c473..3b13b875 100644 --- a/Frameworks/DocumentWindow/src/DocumentCommand.mm +++ b/Frameworks/DocumentWindow/src/DocumentCommand.mm @@ -288,7 +288,7 @@ void run (bundle_command_t const& command, ng::buffer_t const& buffer, ng::range else { if(document && document->is_open()) - baseEnv = ng::editor_for_document(document)->variables(baseEnv, document->path_attributes()); + baseEnv = ng::editor_for_document(document)->variables(baseEnv, to_s([controller scopeAttributes])); else if(document) baseEnv = document->variables(baseEnv); else