Fix highlighting when end of highlight is at the end of a line.