issue #21511: Reworks line number handling to deal gracefully with deletions.