public override void Redo (TextBuffer buffer) { TextIter insertIter = buffer.GetIterAtOffset (index); buffer.InsertRange (ref insertIter, chop.Start, chop.End); buffer.MoveMark (buffer.SelectionBound, buffer.GetIterAtOffset (index)); buffer.MoveMark (buffer.InsertMark, buffer.GetIterAtOffset (index + chop.Length)); }
public override void Undo (TextBuffer buffer) { #if DEBUG Console.WriteLine ("DEBUG: Chop Text: {0} Length: {1}", chop.Text, chop.Length); #endif TextIter startIter = buffer.GetIterAtOffset (index); TextIter endIter = buffer.GetIterAtOffset (index + chop.Length); buffer.Delete (ref startIter, ref endIter); buffer.MoveMark (buffer.InsertMark, buffer.GetIterAtOffset (index)); buffer.MoveMark (buffer.SelectionBound, buffer.GetIterAtOffset (index)); }
public override void Undo (TextBuffer buffer) { TextIter startIter, endIter; #if DEBUG Console.WriteLine ("DEBUG: Whole Region {0}", whole_region); #endif startIter = buffer.GetIterAtOffset (start); buffer.InsertRange (ref startIter, chop.Start, chop.End); if (whole_region) { endIter = buffer.GetIterAtOffset (startIter.Offset + 56); buffer.Delete (ref startIter, ref endIter); } buffer.MoveMark (buffer.InsertMark, buffer.GetIterAtOffset (is_forward ? start : end)); buffer.MoveMark (buffer.SelectionBound, buffer.GetIterAtOffset (is_forward ? end : start)); }
public override void Redo (TextBuffer buffer) { TextIter startIter = buffer.GetIterAtOffset (start); TextIter endIter = buffer.GetIterAtOffset (end); buffer.Delete (ref startIter, ref endIter); buffer.MoveMark (buffer.InsertMark, buffer.GetIterAtOffset (start)); buffer.MoveMark (buffer.SelectionBound, buffer.GetIterAtOffset (start)); }
public void AppendTextWithoutScroll (TextBuffer buffer, string text) { TextIter iter; text = text.Replace("\0",""); buffer.MoveMark(buf.InsertMark, buffer.EndIter); if (text.Equals ("") == false) { iter = buffer.EndIter; buffer.Insert (iter, text); } iter = buffer.EndIter; buffer.Insert (iter, "\n"); }