A text editor is an application which is used to modify the content of files, originally ones containing either plain text, or source code (either for a program, or for early text formatters, which read in specially annotated input, and produced printable output).
Early text editors, used on printing terminals, had a user interface which included editing commands, as well as commands to print groups of lines (so the user could see what the current state of the file they were editing was).
Later on, with the arrival of video terminals, a variety of so-called screen editors evolved, but they generally all tended to show the current exact state of the file (or buffer, until it was written to a file) on the screen.
With the advent of bit-mapped displays, document preparation systems called word processors arrived; they stored their files in private formats (often including binary data), not intended for direct use by users. These always included an editing function, and can usually edit ordinary text files, as well as their private enhanced formats.