public override bool CanMerge(EditAction action) { InsertAction insert = action as InsertAction; if (insert == null) { return(false); } // Don't group text pastes if (is_paste || insert.is_paste) { return(false); } // Must meet eachother if (insert.index != index + chop.Length) { return(false); } // Don't group more than one line (inclusive) if (chop.Text[0] == '\n') { return(false); } // Don't group more than one word (exclusive) if (insert.chop.Text[0] == ' ' || insert.chop.Text[0] == '\t') { return(false); } return(true); }
public override void Merge(EditAction action) { InsertAction insert = (InsertAction)action; chop.End = insert.chop.End; insert.chop.Destroy(); }
void OnInsertText(object sender, Gtk.InsertTextArgs args) { if (frozen_cnt == 0) { InsertAction action = new InsertAction(args.Pos, args.Text, args.Text.Length, chop_buffer); /* * If this insert occurs in the middle of any * non-splittable tags, remove them first and * add them to the InsertAction. */ frozen_cnt++; action.Split(args.Pos, buffer); frozen_cnt--; AddUndoAction(action); } }
void OnInsertText (object sender, Gtk.InsertTextArgs args) { if (frozen_cnt == 0) { InsertAction action = new InsertAction (args.Pos, args.Text, args.Text.Length, chop_buffer); /* * If this insert occurs in the middle of any * non-splittable tags, remove them first and * add them to the InsertAction. */ frozen_cnt++; action.Split(args.Pos, buffer); frozen_cnt--; AddUndoAction (action); } }