private void GoTo(int destLine)
{
// If some text is selected in the diff/preview, don't focus edit box else selected text will not be copyable by keyboard shortcuts
if (webBrowser.TextSelected())
return;
try
{
EditBoxTab.SelectedTab = tpEdit;
txtEdit.Select();
if (destLine < 0) return;
MatchCollection mc = Regex.Matches(txtEdit.Text, "\r\n");
destLine = Math.Min(mc.Count, destLine);
if (destLine == 0) txtEdit.Select(0, 0);
else
txtEdit.Select(mc[destLine - 1].Index + 2 - destLine, 0);
txtEdit.ScrollToCaret();
}
catch (Exception ex)
{
ErrorHandler.HandleException(ex);
}
}
#endregion