File tree Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ @implementation GIAdvancedCommitViewController {
53
53
54
54
#pragma mark - Search
55
55
- (void )setupSearch {
56
- [ NSNotificationCenter .defaultCenter addObserver: self selector: @selector ( textDidChange: ) name: NSTextDidChangeNotification object: nil ] ;
56
+ self. searchTextField . delegate = self ;
57
57
}
58
58
59
59
- (void )resetSearch {
@@ -63,17 +63,16 @@ - (void)resetSearch {
63
63
self.searchTextField .nextResponder = self.messageTextView ;
64
64
}
65
65
66
- - (void )unsetSearch {
67
- [NSNotificationCenter .defaultCenter removeObserver: self ];
68
- }
69
-
70
- - (void )textDidChange : (NSNotification *)notification {
71
- NSString *text = self.searchTextField .stringValue ;
72
- if ([@" " isEqualToString: text]) {
73
- [self .repository updateFilePattern: nil ];
74
- }
75
- else {
76
- [self .repository updateFilePattern: text];
66
+ #pragma mark - NSControlTextEditingDelegate
67
+ - (void )controlTextDidChange : (NSNotification *)obj {
68
+ if (obj.object == self.searchTextField ) {
69
+ NSString *text = self.searchTextField .stringValue ;
70
+ if ([@" " isEqualToString: text]) {
71
+ [self .repository updateFilePattern: nil ];
72
+ }
73
+ else {
74
+ [self .repository updateFilePattern: text];
75
+ }
77
76
}
78
77
}
79
78
@@ -138,10 +137,6 @@ - (void)viewWillDisappear {
138
137
[self resetSearch ];
139
138
}
140
139
141
- - (void )dealloc {
142
- [self unsetSearch ];
143
- }
144
-
145
140
#pragma mark - Repository Handling
146
141
- (void )repositoryStatusDidUpdate {
147
142
[super repositoryStatusDidUpdate ];
You can’t perform that action at this time.
0 commit comments