Removed duplicate paste commands for autotype

This commit is contained in:
michael starke
2014-08-20 01:42:55 +02:00
parent 55d1644b17
commit d1fc013f1c
4 changed files with 18 additions and 7 deletions

View File

@@ -151,8 +151,14 @@
+ (void)appendPasteCommandForContent:(NSString *)pasteContent toCommands:(NSMutableArray *)commands {
if(pasteContent) {
MPAutotypePaste *pasteCommand = [[MPAutotypePaste alloc] initWithString:pasteContent];
[commands addObject:pasteCommand];
/* Update an already inserted paste command with the new conents */
if([[commands lastObject] isKindOfClass:[MPAutotypePaste class]]) {
[[commands lastObject] appendString:pasteContent];
}
else {
MPAutotypePaste *pasteCommand = [[MPAutotypePaste alloc] initWithString:pasteContent];
[commands addObject:pasteCommand];
}
}
}