Skip to content

Commit

Permalink
Include trailing blank lines in paragraph objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonbloom committed Sep 2, 2017
1 parent 9edc7c7 commit d2ec4d3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/actions/textobject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,18 @@ export class SelectParagraph extends TextObjectMovement {
}
}

// Include additional blank lines.
let stop = position.getCurrentParagraphEnd();
while (
TextEditor.getLineAt(stop.getDown(0)).text.trim() === '' &&
stop.line < TextEditor.getLineCount() - 1
) {
stop = stop.getDown(0);
}

return {
start: start,
stop: position.getCurrentParagraphEnd(),
stop: stop,
};
}
}
Expand Down

0 comments on commit d2ec4d3

Please sign in to comment.