If you're worried about this sort of thing happening to you - and you should be - this comment is a reminder that disability insurance exists and is extremely reasonably priced on a software developer or other white-collar professional salary. With an insurance policy paying the bills, you can plan on taking unpaid time off to take care of your partner if the worst should happen.
It's morbid to think about, but going into these situations with a robust contingency plan absolutely beats the alternative.