"Highlight active line" improvement

This is for #5293.