public override void Execute() { FindDialog.CloseIfOpen(); FindInFilesDialog.CloseIfOpen(); ReplaceDialog replaceDialog = ReplaceDialog.GetReplaceDialog(this.FindReplaceModel, this.TextEditor, this.MessageDisplayService); if (!this.TextEditor.IsSelectionEmpty) { string text = this.TextEditor.GetText(this.TextEditor.SelectionStart, this.TextEditor.SelectionLength); if (!string.IsNullOrEmpty(text) && text.IndexOf('\n') == -1) { replaceDialog.FindText = text; } } replaceDialog.Show(); }
public override void Execute() { ReplaceDialog.CloseIfOpen(); FindInFilesDialog.CloseIfOpen(); FindDialog findDialog = FindDialog.GetFindDialog(this.FindReplaceModel, this.TextEditor, this.MessageDisplayService); if (string.IsNullOrEmpty(findDialog.FindText)) { findDialog.SearchReverse = false; findDialog.Show(); } else { if (!findDialog.FindNext()) { return; } this.TextEditor.Focus(); } }