fix splitting path by extension

fixes issue #5
Merge pull request #6 from asfaltboy/fix-autocompletion

Fix splitting path by extension