If you are not looking for something casual then it's better to leave them when they say this to you.
If they are not sure about you now, it is unlikely they will be sure about you later
They are not interested to be with you long-term. May be they are in search of someone else already...
If you have been seeing each other for quite some time now then they don't see you in their future.
They don't value you and are not interested in you.
Your partner needs to heal their wounds from their previous relationship or else they will cause both you and themselves unhappiness