diff --git a/Frameworks/DocumentWindow/src/DocumentController.mm b/Frameworks/DocumentWindow/src/DocumentController.mm index 4e8d4635..b80c7e49 100644 --- a/Frameworks/DocumentWindow/src/DocumentController.mm +++ b/Frameworks/DocumentWindow/src/DocumentController.mm @@ -32,6 +32,7 @@ namespace find_tags { enum { in_document = 1, in_selection, in_project, in_folder }; } // From AppController.h +static NSString* const kUserDefaultsFindInSelectionByDefault = @"findInSelectionByDefault"; static NSString* const OakDocumentPboardType = @"OakDocumentPboardType"; // drag’n’drop of tabs static BOOL IsInShouldTerminateEventLoop = NO; @@ -1782,7 +1783,7 @@ namespace find.projectIdentifier = self.identifier; NSInteger mode = [sender respondsToSelector:@selector(tag)] ? [sender tag] : find_tags::in_document; - if(mode == find_tags::in_document && [self.window isKeyWindow] && self.textView.hasMultiLineSelection) + if(mode == find_tags::in_document && [[NSUserDefaults standardUserDefaults] boolForKey:kUserDefaultsFindInSelectionByDefault] && [self.window isKeyWindow] && self.textView.hasMultiLineSelection) mode = find_tags::in_selection; switch(mode)