private void ShowForm()
{
if (_window.Visible) return;
// Reset the search in
if (_window.SearchIn == SearchInOptions.SelectedText)
_window.SearchIn = SearchInOptions.CurrentDocument;
// If selection is small, use it as find text, otherwise search in selection.
var selLength = _editor.GetSelectionLength();
if (selLength > 1)
{
var selectedText = _editor.GetSelectedText();
if (selLength < UseSelectionAsFindTextLength && !selectedText.Contains("\n"))
_window.FindText = selectedText;
else
_window.SearchIn = SearchInOptions.SelectedText;
}
_window.Show(_owner);
}