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:
Allan Odgaard
2013-05-09 21:37:49 +07:00
parent a6cf964e9f
commit 92192341d4
2 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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;