Created
April 20, 2015 16:00
-
-
Save bratsche/f0867ab01dc82e4a7c9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void HandleSearchEntryActivated (object sender, EventArgs e) | |
{ | |
var pattern = SearchPopupSearchPattern.ParsePattern (ToolbarView.SearchText); | |
if (pattern.Pattern == null && pattern.LineNumber > 0) { | |
DestroyPopup (); | |
var doc = IdeApp.Workbench.ActiveDocument; | |
if (doc != null && doc.Editor != null) { | |
doc.Select (); | |
doc.Editor.Caret.Location = new Mono.TextEditor.DocumentLocation (pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1); | |
doc.Editor.CenterToCaret (); | |
doc.Editor.Parent.StartCaretPulseAnimation (); | |
} | |
return; | |
} | |
if (popup != null) { | |
// XXX - this may not be the most appropriate place for this, but it seems to work... | |
var win = IdeApp.Workbench.RootWindow; | |
var nswindow = MonoDevelop.Components.Mac.GtkMacInterop.GetNSWindow (win); | |
nswindow.MakeFirstResponder (nswindow.ContentView); | |
popup.OpenFile (); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment