From b8359528236667dcdc90ebce9afa930ff756e429 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Thu, 20 Jun 2013 21:52:52 +0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20pre-select=20(find)=20=E2=80=9C?= =?UTF-8?q?in=20selection=E2=80=9D=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously this would be selected if the user had a multi-line selection and was pressing ⌘F. The old behavior can be restored using: defaults write findInSelectionByDefault -bool YES --- Frameworks/DocumentWindow/src/DocumentController.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)