Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,11 @@ private void ExpandToEnclosingUnit(TextUnit unit, bool expandStart, bool expandE
_start = lineRange.Start.CreatePointer();
}
// If this line contains also end position, move it to the
// end of this line.
if (lineRange.Contains(_end))
// end of this line. Also handle blank/empty lines where
// lineRange.Start == lineRange.End (ContentLength == 0):
// snap _end to the blank line boundary so expandEnd doesn't
// bleed into the next line.
if (lineRange.Contains(_end) || lineRange.Start.CompareTo(lineRange.End) == 0)
{
snapEndPosition = false;
if (_end.CompareTo(lineRange.End) != 0)
Expand Down