Fixed an edge case when last char of a paragraph is part of the selection.