protected override void Run() { var line = Editor.GetLine(Editor.Caret.Line); Editor.SetSelection(Editor.Caret.Offset, line.EndOffset); ClipboardActions.Cut(Editor); }
protected override void Run() { var count = Math.Min(Math.Max(Count, 1), Editor.GetLine(Editor.Caret.Line).EndOffset - Editor.Caret.Offset); Editor.SetSelection(Editor.Caret.Offset, Editor.Caret.Offset + count); ClipboardActions.Cut(Editor); }
protected void ChangeInside(char start, char end) { if (Editor.Text[Editor.Caret.Offset] != start) { return; } // FIXME: should not be restricted inside a line // FIXME: should find the *matching* character, not next int offset = StringUtils.FindNextInLine(Editor.Text, Editor.Caret.Offset, end); if (offset <= 0) { return; } CaretMoveActions.Right(Editor); if (Editor.Caret.Offset < offset) { Editor.SetSelection(Editor.Caret.Offset, offset); ClipboardActions.Cut(Editor); } RequestedMode = Mode.Insert; }
protected override void Run() { int wordOffset = StringUtils.NextWordOffset(Editor.Text, Editor.Caret.Offset); Editor.SetSelection(Editor.Caret.Offset, wordOffset); ClipboardActions.Cut(Editor); }
protected bool DeleteInside(char start, char end) { Tuple <int, int> offsets; if (start == end) { offsets = StringUtils.FindMatchingOffsetsInLine(Editor.Text, Editor.Caret.Offset, start); } else { offsets = StringUtils.FindMatchingOffsets(Editor.Text, Editor.Caret.Offset, start, end); } if (offsets.Item1 < 0 || offsets.Item2 < 0) { return(false); } if (offsets.Item1 < offsets.Item2 - 1) { Editor.SetSelection(offsets.Item1 + 1, offsets.Item2); ClipboardActions.Cut(Editor); } else { Editor.Caret.Offset = offsets.Item2; } return(true); }
protected override void Run() { var range = _selector(); DeleteRange(range); if (range != CommandRange.Empty) { // Make sure there is no more than one newline left inside block int del1 = NewLine.GetDelimiterLength(Editor.Text[range.Start - 1], Editor.Text[range.Start]); if (del1 > 0) { int del2Start = range.Start - 1 + del1; int del2 = NewLine.GetDelimiterLength(Editor.Text[del2Start], Editor.Text[del2Start + 1]); if (del2 > 0) { Editor.SetSelection(del2Start, del2Start + del2); ClipboardActions.Cut(Editor); // put caret on closingChar int caret = Editor.Caret.Offset; while (Char.IsWhiteSpace(Editor.Text[caret])) { caret++; } Editor.Caret.Offset = caret; } } } }
protected void DeleteRange(CommandRange range) { if (range.Length > 0) { Editor.SetSelection(range.Start, range.End); ClipboardActions.Cut(Editor); } }
protected override void Run() { int start = Editor.Caret.Offset; CaretMoveActions.LineEnd(Editor); Editor.SetSelection(start, Editor.Caret.Offset); ClipboardActions.Cut(Editor); RequestedMode = Mode.Insert; }
protected override void Run() { var range = _selector(); if (range.Length > 0) { Editor.SetSelection(range.Start, range.End); ClipboardActions.Cut(Editor); RequestedMode = Mode.Insert; } }
/// <summary> /// The cut menu handler /// </summary> /// <param name="sender">The sending object</param> /// <param name="e">The event arguments</param> private void OnCut(object sender, EventArgs e) { try { ClipboardActions.Cut(textEditor.TextArea.GetTextEditorData()); } catch (Exception err) { ShowError(err); } }
protected override void Run() { int offset = Editor.Caret.Offset; for (int i = 0; i < Count && offset < Editor.Length; i++) { offset = StringUtils.NextWordOffset(Editor.Text, offset); } Editor.SetSelection(Editor.Caret.Offset, offset); ClipboardActions.Cut(Editor); }
protected override void Run() { var lineOffset = Editor.GetLine(Editor.Caret.Line).Offset; var count = Math.Min(Math.Max(Count, 1), Editor.Caret.Offset - Editor.GetLine(Editor.Caret.Line).Offset); if (Editor.Caret.Column == 1 || count > Editor.Caret.Offset) { return; } Editor.SetSelection(Editor.Caret.Offset - (count), Editor.Caret.Offset); ClipboardActions.Cut(Editor); }
protected override void Run() { for (int i = 0; i < Count; i++) { int start = Editor.Caret.Offset; var end = StringUtils.FindNextInLine(Editor.Text, Editor.Caret.Offset, Argument); if (end <= 0) { return; } end += findResultShift; Editor.SetSelection(start, end); ClipboardActions.Cut(Editor); } }
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); }
/// <summary> /// The cut menu handler /// </summary> /// <param name="sender">The sending object</param> /// <param name="e">The event arguments</param> private void OnCut(object sender, EventArgs e) { ClipboardActions.Cut(textEditor.TextArea.GetTextEditorData()); }
protected override void Run() { ClipboardActions.Cut(Editor); RequestedMode = Mode.Insert; }
protected override void Run() { Editor.SetSelection(Editor.Caret.Offset, StringUtils.NextWordOffset(Editor.Text, Editor.Caret.Offset)); ClipboardActions.Cut(Editor); RequestedMode = Mode.Insert; }
bool IEditorOperations.CutSelection() { ClipboardActions.Cut(TextEditor.GetTextEditorData()); return(true); }
public void CutText(object obj, EventArgs args) { ClipboardActions.Cut(this.editor.GetTextEditorData()); }