public Range FindPrevious(string searchString, bool wrap, SearchFlags flags, Range searchRange) { int caret = Scintilla.Caret.Position; if (!searchRange.PositionInRange(caret)) return Find(searchRange.End, searchRange.Start, searchString, flags); int anchor = Scintilla.Caret.Anchor; if (!searchRange.PositionInRange(anchor)) anchor = caret; Range r = Find(anchor, searchRange.Start, searchString, flags); if (r != null) return r; else if (wrap) return Find(searchRange.End, anchor, searchString, flags); else return null; }
public Range FindPrevious(Regex findExpression, bool wrap, Range searchRange) { int caret = Scintilla.Caret.Position; if (!searchRange.PositionInRange(caret)) return Find(searchRange.Start, searchRange.End, findExpression, true); int anchor = Scintilla.Caret.Anchor; if (!searchRange.PositionInRange(anchor)) anchor = caret; Range r = Find(searchRange.Start, anchor, findExpression, true); if (r != null) return r; else if (wrap) return Find(anchor, searchRange.End, findExpression, true); else return null; }
public Range FindNext(Regex findExpression, bool wrap, Range searchRange) { int caret = Scintilla.Caret.Position; if (!searchRange.PositionInRange(caret)) return Find(searchRange.Start, searchRange.End, findExpression, false); Range r = Find(caret, searchRange.End, findExpression); if (r != null) return r; else if (wrap) return Find(searchRange.Start, caret, findExpression); else return null; }
public Range FindNext(string searchString, bool wrap, SearchFlags flags, Range searchRange) { int caret = Scintilla.Caret.Position; if (!searchRange.PositionInRange(caret)) return Find(searchRange.Start, searchRange.End, searchString, flags); Range r = Find(caret, searchRange.End, searchString, flags); if (r != null) return r; else if (wrap) return Find(searchRange.Start, caret, searchString, flags); else return null; }
public bool IntersectsWith(Range otherRange) { return otherRange.PositionInRange(this._start) | otherRange.PositionInRange(this._end) | this.PositionInRange(otherRange.Start) | this.PositionInRange(otherRange.End); }