Skip to content

Commit 0480acf

Browse files
committed
don't set caret offset longer than text length
1 parent 6e1b180 commit 0480acf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

SharpFM.App/DocumentTextBindingBehavior.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ private void TextPropertyChanged(string text)
5555
{
5656
var caretOffset = _textEditor.CaretOffset;
5757
_textEditor.Document.Text = text;
58-
//_textEditor.CaretOffset = caretOffset;
58+
if (caretOffset <= text.Length)
59+
{
60+
_textEditor.CaretOffset = caretOffset;
61+
}
5962
}
6063
}
6164
}

0 commit comments

Comments
 (0)