Restore the correct selections after "Toggle line comment"

This fixes #7293 @peterflynn