コード例 #1
0
        public override void Redo(Gtk.TextBuffer buffer)
        {
            RemoveSplitTags(buffer);

            Gtk.TextIter idx_iter = buffer.GetIterAtOffset(index);
            buffer.InsertRange(ref idx_iter, chop.Start, chop.End);

            buffer.MoveMark(buffer.SelectionBound, buffer.GetIterAtOffset(index));
            buffer.MoveMark(buffer.InsertMark,
                            buffer.GetIterAtOffset(index + chop.Length));
        }
コード例 #2
0
        public override void Undo(Gtk.TextBuffer buffer)
        {
            int tag_images = GetSplitOffset();

            Gtk.TextIter start_iter = buffer.GetIterAtOffset(start - tag_images);
            buffer.InsertRange(ref start_iter, chop.Start, chop.End);

            buffer.MoveMark(buffer.InsertMark,
                            buffer.GetIterAtOffset(is_forward ? start - tag_images
                                                                 : end - tag_images));
            buffer.MoveMark(buffer.SelectionBound,
                            buffer.GetIterAtOffset(is_forward ? end - tag_images
                                                                 : start - tag_images));

            ApplySplitTags(buffer);
        }