Improve tabline support

Ref #1046, #1049, #1047, #1048.