Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. IEnumerable<SelectionSegment> selectionSegments = Editor.TextArea.Selection.Segments;
  2. TextDocument document = Editor.TextArea.Document;
  3. foreach (SelectionSegment segment in selectionSegments)
  4. {
  5. //DO WHAT YOU WANT WITH THE SELECTIONS
  6. int lineStart = document.GetLineByOffset(segment.StartOffset).LineNumber;
  7. int lineEnd = document.GetLineByOffset(segment.EndOffset).LineNumber;
  8. for (int i = lineStart; i <= lineEnd; i++)
  9. {
  10. //Do something with each line in the selection segment
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement