diff options
author | Jeremie Laval <jeremie.laval@gmail.com> | 2012-11-21 18:08:41 +0400 |
---|---|---|
committer | Jeremie Laval <jeremie.laval@gmail.com> | 2012-11-21 18:08:41 +0400 |
commit | 39f0689e2821e0e3e2843491c606d888474fb665 (patch) | |
tree | fd0853e7ee39d910aee614be4278d8150ad2b543 | |
parent | 88f139eaa6ece353bad2d7e504a8efe2dfc809f4 (diff) |
[macdoc] Unselect search field after a search triggered so that text is not overwritten when user types slowly
-rw-r--r-- | MyDocument.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/MyDocument.cs b/MyDocument.cs index d802858..7f2eecd 100644 --- a/MyDocument.cs +++ b/MyDocument.cs @@ -385,10 +385,12 @@ namespace macdoc partial void StartSearch (NSSearchField sender) { var contents = sender.StringValue; - if (contents == null || contents == "") + if (string.IsNullOrEmpty (contents)) return; tabSelector.SelectAt (2); Search (contents); + // Unselect the search term in case user is typing slowly + sender.CurrentEditor.SelectedRange = new NSRange (contents.Length, 0); } // Typing in the index panel |