aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPEditSheetTextView.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPEditSheetTextView.m')
-rw-r--r--Source/SPEditSheetTextView.m13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/SPEditSheetTextView.m b/Source/SPEditSheetTextView.m
index 0d309f35..e46868b7 100644
--- a/Source/SPEditSheetTextView.m
+++ b/Source/SPEditSheetTextView.m
@@ -64,7 +64,7 @@
[super cut:sender];
}
-/*
+/**
* Validate undo and redo menu items
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
@@ -99,9 +99,7 @@
return;
}
- // NSString *characters = [theEvent characters];
NSString *charactersIgnMod = [theEvent charactersIgnoringModifiers];
- // unichar insertedCharacter = [characters characterAtIndex:0];
long curFlags = ([theEvent modifierFlags] & allFlags);
if(curFlags & NSCommandKeyMask) {
@@ -119,6 +117,15 @@
}
}
+ // Allow undo grouping if user typed a ' ' (for word level undo)
+ // or a RETURN but not for each char due to writing speed
+ if([charactersIgnMod isEqualToString:@" "]
+ || [theEvent keyCode] == 36
+ || [theEvent modifierFlags] & (NSCommandKeyMask|NSControlKeyMask|NSAlternateKeyMask)
+ ) {
+ [[self delegate] setDoGroupDueToChars];
+ }
+
[super keyDown: theEvent];
}