private void UpdateSelection() { if (Select == SelectMode.Line) { var startLine = Editor.GetLineByOffset(_startOffset); var endLine = Editor.GetLineByOffset(Editor.Caret.Offset); Motion.SetSelectLines(Editor, startLine.LineNumber, endLine.LineNumber); } else { // Make sure we always select whole eol symbol DocumentLine line = Editor.GetLine(Editor.Caret.Line); int end; if (Editor.Caret.Offset >= line.EndOffset && Editor.Caret.Offset < line.EndOffsetIncludingDelimiter - 1) { end = line.EndOffsetIncludingDelimiter - 1; } else { end = Editor.Caret.Offset; } Editor.SetSelection(_startOffset + (Editor.Caret.Offset < _startOffset ? 1 : 0), end + (Editor.Caret.Offset >= _startOffset ? 1 : 0)); } }
private void UpdateSelection() { if (Select == SelectMode.Line) { var startLine = Editor.GetLineByOffset(_startOffset); var endLine = Editor.GetLineByOffset(Editor.Caret.Offset); Motion.SetSelectLines(Editor, startLine.LineNumber, endLine.LineNumber); } else { Editor.SetSelection(_startOffset + (Editor.Caret.Offset < _startOffset ? 1 : 0), Editor.Caret.Offset + (Editor.Caret.Offset >= _startOffset ? 1 : 0)); } }
protected override void Run() { // hack for last line, it doesn't actually cut the line though if (Editor.Caret.Offset == Editor.Text.Length) { var line = Editor.GetLine(Editor.Caret.Line); if (line.Offset == line.EndOffset) { DeleteActions.Backspace(Editor); return; } } Motion.SetSelectLines(Editor, Editor.Caret.Line, Editor.Caret.Line + Count + (Count > 0 ? -1 : 0)); ClipboardActions.Cut(Editor); Motion.LineStart(Editor); }
protected override void Run() { Motion.SetSelectLines(Editor, Editor.Caret.Line, Editor.Caret.Line); MiscActions.RemoveIndentSelection(Editor); Editor.ClearSelection(); }
protected override void Run() { Motion.SetSelectLines(Editor, Editor.Caret.Line, Editor.Caret.Line + Count - 1); ClipboardActions.Copy(Editor); Editor.ClearSelection(); }