fixed bug where headingOffsets went out-of-sync on window resize
fixed mixed tabs and spaces
calculate offsets only if needed (needs lots of time in case of large
selector-item-size)