While text editors offer functionalities that solely focus on simplifying creating and editing documents, source-code editors provide additional features to speed up the code writing process.
The difference between both kinds, at large, lies in the functionality and purpose that they serve. Text editors come in various forms, but you can broadly classify them as basic text editors (plain text or rich text) and source-code editors. Text Editors to Improve Text and Code Writing/Editing.