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() { // 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) { if (Editor.Caret.Line == 1) { Editor.Caret.Offset = 0; Editor.InsertAtCaret(text); Editor.Caret.Offset = 0; Motion.LineStart(Editor); } else { Motion.Up(Editor); Motion.LineEnd(Editor); Editor.Caret.Offset++; int oldOffset = Editor.Caret.Offset; Editor.InsertAtCaret(text); Editor.Caret.Offset = oldOffset; Motion.LineStart(Editor); } } else { Editor.InsertAtCaret(text); Editor.Caret.Offset--; } RequestedMode = Mode.Normal; }
protected override void Run() { Motion.LineEnd(Editor); }
protected override void Run() { Motion.LineEnd(Editor); RequestedMode = Mode.Insert; }