selection hover improvements

fix issue with wrapped lines and compute only when necessary.