Don't quit your job until you've found another one. There is no sense being sad AND broke.
This guy you are so unable to quit... well you were ON AND OFF with him which is natures way of telling you that you're with the wrong fella. Take that at face value, accept the truth which is that you're better off without someone who is in and out of your life. It's like quitting smoking... you;ll never stop if you keep having a drag. So: Butt this guy out for good. No more talk outside of work, no wishing you were still in a dysfunctional relationship with him where you felt good until you needed to leave one another again... that's just stupidity at its finest. I know, easier said then done but no one said it would be easy for you to just get on with your life without him in it but either is quitting smoking and I DO know for sure that once you make your mind up to never put another one in your mouth, you soon enough are indifferent to it and you never want to have another drag again.
“The willingness to accept responsibility for one’s own life is the source from which self-respect springs.” ~Joan Didion