TextDocument document = textEditor.Document;
DocumentLine start = document.GetLineByOffset(textEditor.SelectionStart);
DocumentLine end = document.GetLineByOffset(textEditor.SelectionStart + textEditor.SelectionLength);
using (document.RunUpdate()) {
for (DocumentLine line = start; line != end; line = line.NextLine)
{
document.Insert(line.Offset, "// ");
}
}
Last active
August 28, 2019 03:50
-
-
Save DamianSuess/115ff647c0d1c11760fa5cb9b3fdc74e to your computer and use it in GitHub Desktop.
C# AvalonEdit Comment Lines
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment