private void btnReplacePrevious_Click(object sender, EventArgs e)
{
if (this.cboFindR.Text == string.Empty)
return;
this.AddReplacMru();
this.lblStatus.Text = string.Empty;
Range nextRange = null;
try
{
nextRange = this.ReplaceNext(true);
}
catch (ArgumentException ex)
{
this.lblStatus.Text = "Error in Regular Expression: " + ex.Message;
return;
}
if (nextRange == null)
{
this.lblStatus.Text = "Match could not be found";
}
else
{
if (nextRange.Start > this.Scintilla.Caret.Anchor)
{
if (this.chkSearchSelectionR.Checked)
this.lblStatus.Text = "Search match wrapped to the begining of the selection";
else
this.lblStatus.Text = "Search match wrapped to the begining of the document";
}
nextRange.Select();
this.MoveFormAwayFromSelection();
}
}