Fix incorrect remapping of line numbers on resize