Context switch in an Text Editor
There is no single answer: you could build a text editor in any way you want.
One simple architecture for a text editor is to have a single process, which blocks on I/O when it is waiting for the user to provide input.  But it's also possible for a text editor to be built in a multi-threaded way with multiple processes, e.g., spawning one thread to do spellchecking in the background or anything else.