/// <summary> /// Called to record the paste operation in the undo subsystem. /// </summary> /// <param name="text"> /// The text being pasted. /// </param> /// <param name="position"> /// The position in the buffer at /// which the pasted text will be inserted. /// </param> /// <param name="anchor"> /// The recorded position in the buffer /// from which the paste operation originates. /// This is usually the same as Position, but /// not always. For instance, when pasting a /// linewise selection before the current line, /// the Anchor is the cursor position, whereas /// the Position is the beginning of the previous line. /// </param> private void RecordPaste(string text, int position, int anchor) { if (_singleton != null) { var editItem = EditItemInsertLines.Create( text, position, anchor ); _singleton.SaveEditItem(editItem); } }