auto-indent: improvements to label detection