It's essential to deal with idea theft right away. If you don't stop someone else from taking credit for your ideas, it will become a recurring pattern that derails your career. Confronting the thief in private might keep this from happening again but won't help you recover the lost credit. That will require bringing the issue to you supervisor. The only way to do this without seeming petty is to acknowledge that's how it may appear, but offer nobler, less selfish reasons as the real motivations. It matters less that you're actually believed than that it gives you a rationale to bring the facts to your supervisor's attention.
This script can be modified to: