mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-23 22:09:25 +00:00
Fixed autotype for fields containing curly brackets
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
NSUInteger reserverd = MAX(1,[context.normalizedCommand length] / 4);
|
||||
NSMutableArray *commands = [[NSMutableArray alloc] initWithCapacity:reserverd];
|
||||
NSMutableArray __block *commandRanges = [[NSMutableArray alloc] initWithCapacity:reserverd];
|
||||
NSRegularExpression *commandRegExp = [[NSRegularExpression alloc] initWithPattern:@"\\{[^\\}]+\\}" options:NSRegularExpressionCaseInsensitive error:0];
|
||||
NSRegularExpression *commandRegExp = [[NSRegularExpression alloc] initWithPattern:@"\\{[^\\{\\}]+\\}" options:NSRegularExpressionCaseInsensitive error:0];
|
||||
NSAssert(commandRegExp, @"RegExp is constant. Has to work all the time");
|
||||
[commandRegExp enumerateMatchesInString:context.evaluatedCommand options:0 range:NSMakeRange(0, [context.evaluatedCommand length]) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) {
|
||||
@autoreleasepool {
|
||||
@@ -160,6 +160,9 @@
|
||||
if(!commandString) {
|
||||
return;
|
||||
}
|
||||
/* TODO: Test for special Commands */
|
||||
/* TODO: fall back to paste if nothing matches */
|
||||
|
||||
|
||||
NSNumber *keyCodeNumber = [self keypressCommands][commandString];
|
||||
|
||||
@@ -167,6 +170,9 @@
|
||||
CGKeyCode keyCode = [keyCodeNumber keyCodeValue];
|
||||
[commands addObject:[[MPAutotypeKeyPress alloc] initWithModifierMask:flags keyCode:keyCode]];
|
||||
}
|
||||
else {
|
||||
[self appendPasteCommandForContent:commandString toCommands:commands];
|
||||
}
|
||||
}
|
||||
|
||||
+ (BOOL)updateModifierMask:(CGEventFlags *)mask forCommand:(NSString *)commandString {
|
||||
|
||||
Reference in New Issue
Block a user