Add more precise caching for tagbar segment

Ref #700.