public void FindPrevDiff(FastColoredTextBox tb) { int oldLine = tb[tb.Selection.Start.iLine].LineNo - 1; int newLine = oldLine; List<int> list = tb == tb1 ? RedLines1 : GreenLines2; for (int i = list.Count - 1; i >= 0; i--) { if (list[i] < oldLine) { newLine = list[i]; break; } } if (oldLine != newLine) tb.NavigateToLineNum(newLine + 1, true); tb.Focus(); }
public void FindNextDiff(FastColoredTextBox tb = null) { if (tb == null) tb = tb1.Focused ? tb1 : tb2; int oldLine = tb[tb.Selection.Start.iLine].LineNo - 1; int newLine = oldLine; List<int> list = tb == tb1 ? RedLines1 : GreenLines2; foreach (var e in list) { if (e > oldLine) { newLine = e; break; } } if (oldLine != newLine) tb.NavigateToLineNum(newLine + 1, true); tb.Focus(); }