The new method wraps around perfectly when the new selection positions overlap each other. This patch also fixes the shift selection drifting when lines are getting deleted.