protected override void Run() { // can the clipboard content be pulled without Gtk? var clipboard = Gtk.Clipboard.Get(ClipboardActions.CopyOperation.CLIPBOARD_ATOM); if (!clipboard.WaitIsTextAvailable()) { return; } string text = clipboard.WaitForText(); if (text.IndexOfAny(new char[] { '\r', '\n' }) > 0) { int oldOffset = Editor.Caret.Offset; CaretMoveActions.LineEnd(Editor); Editor.Caret.Offset++; Editor.InsertAtCaret(text); Editor.Caret.Offset = oldOffset; Motion.Down(Editor); Motion.LineStart(Editor); } else { Editor.Caret.Offset++; Editor.InsertAtCaret(text); Editor.Caret.Offset--; } }
protected override void Run() { Motion.LineStart(Editor); int start = Editor.Caret.Offset; Motion.LineEnd(Editor); Editor.SetSelection(start, Editor.Caret.Offset); ClipboardActions.Cut(Editor); RequestedMode = Mode.Insert; }
protected override void Run() { if (Count == 0) { CaretMoveActions.ToDocumentEnd(Editor); } else { Editor.Caret.Line = Count; } Motion.LineStart(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); }
protected override void Run() { Editor.Caret.Line -= Math.Min(Editor.Caret.Line - 1, 20); Motion.LineStart(Editor); Editor.CenterToCaret(); }
protected override void Run() { Motion.LineStart(Editor); }
protected override void Run() { Motion.LineStart(Editor); RequestedMode = Mode.Insert; }
protected override void Run() { Editor.Caret.Line = 1; Motion.LineStart(Editor); }