Fix line merging order when merging more than two close lines
We should simply sort the lines in order to merge the left-most lines before the right-most ones.
We should simply sort the lines in order to merge the left-most lines before the right-most ones.