Ejemplo n.º 1
0
	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));
	}
Ejemplo n.º 2
0
	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));
	}
Ejemplo n.º 3
0
	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));
	}
Ejemplo n.º 4
0
        void TruncateConsole(TextBuffer buf, int toLength)
        {
            int pre = buf.CharCount;

            TextIter startIter = buf.StartIter;
            TextIter endIter = buf.StartIter;
            endIter.ForwardChars(buf.CharCount - toLength);
            buf.Delete(ref startIter, ref endIter);

            Console.WriteLine("Truncated console. Pre-trunc: {0} Post-trunc: {1}",
                pre, buf.CharCount);
        }