Archived
1

Added Change Notifications to MPExpression, MPMutableExpression and MPFunction

Removed -beginEditing and -endEditing
Optimized -fixSymbols
Updated Project File
This commit is contained in:
Kim Wittenburg
2014-05-18 01:06:49 +02:00
parent fa499d299c
commit 982b70d7fb
5 changed files with 119 additions and 65 deletions

View File

@@ -8,8 +8,9 @@
#import "MPFunction.h"
#import "MPExpression.h"
#import "MPRangePath.h"
#import "NSIndexPath+MPRemoveFirstIndex.h"
#import "NSIndexPath+MPReverseIndexPath.h"
@implementation MPFunction
@@ -156,4 +157,16 @@
return 0;
}
@end
@implementation MPFunction (MPDisplayExtension)
- (void)symbolsChangedInRangePath:(MPRangePath *)rangePath replacementLength:(NSUInteger)length
{
NSUInteger index = [self.parent indexOfSymbol:self];
NSIndexPath *newLocation = [rangePath.location indexPathByPrecedingIndex:index];
MPRangePath *newRangePath = [[MPRangePath alloc] initWithLocation:newLocation length:rangePath.length];
[self.parent symbolsChangedInRangePath:newRangePath replacementLength:length];
}
@end