Skip to content

Commit

Permalink
Merge branch 'release/1.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mjdescy committed Jul 4, 2015
2 parents 0dba5bd + b7fd442 commit e494737
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions TodoTxtMac/TTMFieldEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
@property (nonatomic, retain) NSArray *contextsArray;
@property (nonatomic, retain) NSTimer *completionTimer;
@property (nonatomic) NSUInteger nextInsertionIndex;
@property (nonatomic) NSString *originalValue;

#pragma mark - Autocompletion Timer Methods

Expand Down
14 changes: 7 additions & 7 deletions TodoTxtMac/TTMFieldEditor.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ - (id)initWithFrame:(NSRect)frame
return self;
}

- (BOOL)becomeFirstResponder {
self.originalValue = [self.string copy]; // retain value for cancelOperation method
return ([super becomeFirstResponder]);
}

- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
Expand Down Expand Up @@ -168,13 +173,8 @@ - (NSRange)rangeForUserCompletion {
- (void)cancelOperation:(id)sender {
// How the Esc key behaves is dependent on a user setting.
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"escapeKeyCancelsAllTextChanges"]) {
// Undo all events on the undoManager's stack. Autocompletion triggers additional undo
// groups to be created, so one undo or undoNestedGroup call is not enough to undo all
// changes.
NSUndoManager *undoManager = [self undoManager];
while ([undoManager canUndo]) {
[undoManager undoNestedGroup];
}
[self.undoManager removeAllActions];
self.string = self.originalValue;
} else {
// Trigger autocompletion (default behavior).
[self complete:nil];
Expand Down
4 changes: 2 additions & 2 deletions TodoTxtMac/TodoTxtMac-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.6.0</string>
<string>1.6.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.6.0</string>
<string>1.6.1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit e494737

Please sign in to comment.