Add isCursorOnTag helper for clarity