Don’t update text field when dismissing find history pop-up with escape

This commit is contained in:
Allan Odgaard
2020-04-22 11:27:26 +07:00
parent f3a46a25d6
commit 19d2c96034

View File

@@ -136,6 +136,7 @@ static size_t line_count (std::string const& text)
}
- (void)setTableView:(NSTableView*)aTableView;
@property (nonatomic) BOOL shouldClose;
@property (nonatomic) BOOL shouldCancel;
@end
@implementation OakPasteboardSelectorTableViewHelper
@@ -234,7 +235,8 @@ static size_t line_count (std::string const& text)
- (void)cancel:(id)sender
{
_shouldClose = YES;
_shouldCancel = YES;
_shouldClose = YES;
}
- (void)doCommandBySelector:(SEL)aSelector
@@ -335,7 +337,7 @@ static size_t line_count (std::string const& text)
[parentWindow removeChildWindow:window];
[window orderOut:self];
return [tableView selectedRow];
return tableViewHelper.shouldCancel ? -1 : [tableView selectedRow];
}
- (void)setWidth:(CGFloat)width;