Author: ericwa
Date: Fri Mar 14 19:35:36 2014
New Revision: 10564
URL: http://svn.gna.org/viewcvs/etoile?rev=10564&view=rev
Log:
Typewriter: when the user makes multiple typing diff edits, record one of them
in the metadata along with an 'and other edits' message. This should get rid of
the unspecific 'Typing' metadata you sometimes get
Modified:
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Commits/org.etoile.Typewriter.json
Modified:
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m
URL:
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m?rev=10564&r1=10563&r2=10564&view=diff
==============================================================================
---
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m
(original)
+++
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m
Fri Mar 14 19:35:36 2014
@@ -523,7 +523,7 @@
NSString *identifier = @"typing";
NSArray *descArgs = @[];
- if ([diff.operations count] == 1)
+ if ([diff.operations count] >= 1)
{
COAttributedStringOperation *op = diff.operations[0];
@@ -565,6 +565,16 @@
identifier = @"replace-text";
descArgs = @[opRangeStringTrimmed, insertedTextTrimmed];
}
+ }
+
+ if ([diff.operations count] > 1 && ![identifier isEqualToString:
@"typing"])
+ {
+ identifier = [identifier stringByAppendingString:
@"-and-others-edits"];
+ }
+
+ if ([identifier isEqualToString: @"typing"])
+ {
+ NSLog(@"Can't write description for diff: %@", diff);
}
[self commitWithIdentifier: identifier descriptionArguments: descArgs];
Modified:
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Commits/org.etoile.Typewriter.json
URL:
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Commits/org.etoile.Typewriter.json?rev=10564&r1=10563&r2=10564&view=diff
==============================================================================
---
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Commits/org.etoile.Typewriter.json
(original)
+++
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Commits/org.etoile.Typewriter.json
Fri Mar 14 19:35:36 2014
@@ -236,6 +236,32 @@
{
"type": "modification",
"shortDescription": "Change attributes of text '%@'"
+ },
+
+
+
+ "insert-text-and-others-edits":
+ {
+ "type": "modification",
+ "shortDescription": "Insert text '%@' and other edits"
+ },
+
+ "delete-text-and-others-edits":
+ {
+ "type": "deletion",
+ "shortDescription": "Delete text '%@' and other edits"
+ },
+
+ "replace-text-and-others-edits":
+ {
+ "type": "modification",
+ "shortDescription": "Replace text '%@' with '%@' and
other edits"
+ },
+
+ "modify-text-and-others-edits":
+ {
+ "type": "modification",
+ "shortDescription": "Change attributes of text '%@' and
other edits"
}
}
}
_______________________________________________
Etoile-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-cvs