mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Let OakTextView pass an environment to document::run()
We no longer pass the bundle item by const-reference because it is now used (delayed) in a block and const-references are not captured by blocks (i.e. the lifespan is not extended).
This commit is contained in:
@@ -67,5 +67,5 @@ PUBLIC @interface OakTextView : OakView <NSTextInput, NSTextFieldDelegate>
|
||||
|
||||
- (IBAction)saveScratchMacro:(id)sender;
|
||||
|
||||
- (void)performBundleItem:(bundles::item_ptr const&)anItem;
|
||||
- (void)performBundleItem:(bundles::item_ptr)anItem;
|
||||
@end
|
||||
|
||||
@@ -1122,7 +1122,7 @@ doScroll:
|
||||
return [self variablesForBundleItem:bundles::item_ptr()];
|
||||
}
|
||||
|
||||
- (void)performBundleItem:(bundles::item_ptr const&)item
|
||||
- (void)performBundleItem:(bundles::item_ptr)item
|
||||
{
|
||||
// D(DBF_OakTextView_BundleItems, bug("%s\n", anItem->full_name().c_str()););
|
||||
AUTO_REFRESH;
|
||||
@@ -1146,14 +1146,14 @@ doScroll:
|
||||
if(success)
|
||||
{
|
||||
AUTO_REFRESH;
|
||||
document::run(command, document->buffer(), editor->ranges(), document);
|
||||
document::run(command, document->buffer(), editor->ranges(), document, [self variablesForBundleItem:item]);
|
||||
}
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
command.pre_exec = pre_exec::nop;
|
||||
document::run(command, document->buffer(), editor->ranges(), document);
|
||||
document::run(command, document->buffer(), editor->ranges(), document, [self variablesForBundleItem:item]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user