/// <summary> /// Undo operation /// </summary> public override void Undo() { tb.Selection.Start = sel.Start; tb.Selection.End = lastSel.Start; tb.OnTextChanging(); ClearSelectedCommand.ClearSelected(tb); base.Undo(); }
/// <summary> /// Undo operation /// </summary> public override void Undo() { ts.CurrentTB.Selection.Start = sel.Start; ts.CurrentTB.Selection.End = lastSel.Start; ts.OnTextChanging(); ClearSelectedCommand.ClearSelected(ts); base.Undo(); }
/// <summary> /// Undo operation /// </summary> public override void Undo() { Ts.CurrentTb.Selection.Start = Sel.Start; Ts.CurrentTb.Selection.End = LastSel.Start; Ts.OnTextChanging(); ClearSelectedCommand.ClearSelected(Ts); base.Undo(); }
/// <summary> /// Undo operation /// </summary> public override void Undo() { var tb = ts.CurrentTB; ts.OnTextChanging(); tb.Selection.BeginUpdate(); for (int i = 0; i < ranges.Count; i++) { tb.Selection.Start = ranges[i].Start; for (int j = 0; j < insertedText.Length; j++) { tb.Selection.GoRight(true); } ClearSelectedCommand.ClearSelected(ts); InsertTextCommand.InsertText(prevText[prevText.Count - i - 1], ts); ts.OnTextChanged(ranges[i].Start.iLine, ranges[i].Start.iLine); } tb.Selection.EndUpdate(); ts.NeedRecalc(new TextSource.TextChangedEventArgs(0, 1)); }
/// <summary> /// Execute operation /// </summary> public override void Execute() { tb.OnTextChanging(ref insertedText); this.prevText = tb.Text; tb.Selection.BeginUpdate(); for (int i = ranges.Count - 1; i >= 0; i--) { tb.Selection.Start = ranges[i].Start; tb.Selection.End = ranges[i].End; ClearSelectedCommand.ClearSelected(tb); InsertTextCommand.InsertText(insertedText, tb); } tb.Selection.SelectAll(); tb.Selection.EndUpdate(); tb.needRecalc = true; lastSel = tb.Selection.Clone(); tb.OnTextChanged(lastSel.Start.iLine, lastSel.End.iLine); //base.Execute(); }
/// <summary> /// Execute operation /// </summary> public override void Execute() { var tb = ts.CurrentTB; prevText.Clear(); ts.OnTextChanging(); tb.Selection.BeginUpdate(); for (int i = ranges.Count - 1; i >= 0; i--) { tb.Selection.Start = ranges[i].ReplacedRange.Start; tb.Selection.End = ranges[i].ReplacedRange.End; prevText.Add(tb.Selection.Text); ClearSelectedCommand.ClearSelected(ts); InsertTextCommand.InsertText(ranges[i].ReplaceText, ts); ts.OnTextChanged(ranges[i].ReplacedRange.Start.iLine, ranges[i].ReplacedRange.End.iLine); } tb.Selection.EndUpdate(); ts.NeedRecalc(new TextSource.TextChangedEventArgs(0, 1)); lastSel = new RangeInfo(tb.Selection); }
/// <summary> /// Execute operation /// </summary> public override void Execute() { var tb = Ts.CurrentTb; _prevText.Clear(); Ts.OnTextChanging(); tb.Selection.BeginUpdate(); for (var i = _ranges.Count - 1; i >= 0; i--) { tb.Selection.Start = _ranges[i].ReplacedRange.Start; tb.Selection.End = _ranges[i].ReplacedRange.End; _prevText.Add(tb.Selection.Text); ClearSelectedCommand.ClearSelected(Ts); InsertTextCommand.InsertText(_ranges[i].ReplaceText, Ts); Ts.OnTextChanged(_ranges[i].ReplacedRange.Start.ILine, _ranges[i].ReplacedRange.End.ILine); } tb.Selection.EndUpdate(); Ts.NeedRecalc(new TextSource.TextChangedEventArgs(0, 1)); LastSel = new RangeInfo(tb.Selection); }
/// <summary> /// Undo operation /// </summary> public override void Undo() { var tb = Ts.CurrentTb; Ts.OnTextChanging(); tb.Selection.BeginUpdate(); for (var i = 0; i < _ranges.Count; i++) { tb.Selection.Start = _ranges[i].ReplacedRange.Start; for (var j = 0; j < _ranges[i].ReplaceText.Length; j++) { tb.Selection.GoRight(true); } ClearSelectedCommand.ClearSelected(Ts); var prevTextIndex = _ranges.Count - 1 - i; InsertTextCommand.InsertText(_prevText[prevTextIndex], Ts); Ts.OnTextChanged(_ranges[i].ReplacedRange.Start.ILine, _ranges[i].ReplacedRange.Start.ILine); } tb.Selection.EndUpdate(); Ts.NeedRecalc(new TextSource.TextChangedEventArgs(0, 1)); }