public bool GetSelectionInDocument(out int pos, out int length) { pos = length = 0; if (!HasSelection) { return(false); } Position begin = _selection.BeginDrawPos; Position end = _selection.EndDrawPos; int startPos = _document.Line(begin.Row).Start + begin.Column; int endPos = _document.Line(end.Row).Start + end.Column; pos = startPos; length = endPos - startPos; return(true); }
public static ITextViewLine LastLine(this ITextViewDocument document) { return(document.Line(document.LastLineIndex())); }
public void RemovingBeforeFirstCharacterRemovesLine() { Assert.AreEqual(2, _document.LineCount); _document.Delete(_document.Line(1).Start - 1, 1); Assert.AreEqual(1, _document.LineCount); }