Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noahrichards/142155 to your computer and use it in GitHub Desktop.
Save noahrichards/142155 to your computer and use it in GitHub Desktop.
// starting with a SnapshotPoint, text line, or SnapshotSpan
SnapshotPoint point;
ITextSnapshotLine line = point.GetContainingLine();
SnapshotSpan extent = line.Extent;
SnapshotPoint start;
for (start = extent.Start; start < line.End && char.IsWhitespace(start.GetChar()); start++);
SnapshotSpan extentExcludingLeadingWhitespace = new SnapshotPoint(start, extent.End);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment