ValidateCaretPos() public method

If the caret position is outside the document text bounds it is set to the correct position by calling ValidateCaretPos.
public ValidateCaretPos ( ) : void
return void
Ejemplo n.º 1
0
 protected override void OnEnter(EventArgs e)
 {
     // SD2-1072 - Make sure the caret line is valid if anyone
     // has handlers for the Enter event.
     Caret.ValidateCaretPos();
     base.OnEnter(e);
 }
Ejemplo n.º 2
0
 void DocumentTextContentChanged(object sender, EventArgs e)
 {
     // after the text content is changed abruptly, we need to validate the
     // caret position - otherwise the caret position is invalid for a short amount
     // of time, which can break client code that expects that the caret position is always valid
     Caret.ValidateCaretPos();
 }
Ejemplo n.º 3
0
        void DocumentUpdateCommitted(object sender, EventArgs e)
        {
            if (motherTextEditorControl.IsInUpdate == false)
            {
                Caret.ValidateCaretPos();

                // AdjustScrollBarsOnCommittedUpdate
                if (!scrollToPosOnNextUpdate.IsEmpty)
                {
                    ScrollTo(scrollToPosOnNextUpdate.Y, scrollToPosOnNextUpdate.X);
                }
                if (adjustScrollBarsOnNextUpdate)
                {
                    AdjustScrollBarsClearCache();
                    AdjustScrollBars();
                }
            }
        }