Get text from current line with AvalonEdit

This snippets returns the content of the current line, where the user has its cursor:

int offset = AvalonEditor.CaretOffset;               
DocumentLine line = AvalonEditor.Document.GetLineByOffset(offset);
MessageBox.Show(AvalonEditor.Document.GetText(line.Offset, line.Length));


Datenschutzerklärung | Impressum