Text Editor: Main Articles: and

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

TEXT EDITOR

Plain text vs. rich text[edit]


Main articles: Plain text and rich text
There are important differences between plain text (created and edited by text editors)
and rich text (such as those created by word processors or desktop publishing software).
Plain text exclusively consists of character representation. Each character is represented
by one, two or four bytes, in accordance to character encoding conventions, such
as ASCIIor Unicode. These conventions define many printable characters but also non-
printing characters that control the flow of the text, such space, line break and page
break but plain text contains no other information about the text itself, not even the
character encoding convention employed. Plain text is stored in text files, although text files
do not exclusively store plain text. In the early days of computers, plain text was displayed
using a monospace font, so horizontal alignment and columnar formatting were sometimes
done using whitespace characters. For compatibility reason, this tradition did not change.
Rich text, on the other hand, may contain metadata, character formatting data
(e.g. typeface, size, weight and style), paragraph formatting data (e.g. indentation,
alignment, letter and word distribution, and space between lines or other paragraphs) and
page specification data (e.g. size, margin and reading direction). Rich text can become very
complex. Rich text can be saved in binary format (e.g. DOC), text files adhering to
a markup language (e.g. RTF or HTML) or a hybrid form of both (e.g. Office Open XML).
Text editors are intended to open and save text files containing either plain text or anything
that can be interpretted as plain text, including the markup for rich text or the markup for
something else (e.g. SVG).

History[edit]

A box of punched cards with several program decks.

Before text editors existed, computer text was punched into cards with keypunch machines.
Physical boxes of these thin cardboard cards were then inserted into a card-reader.
Magnetic tape and disk "card-image" files created from such card decks often had no line-
separation characters at all, and assumed fixed-length 80-character records. An alternative
to cards was punched paper tape. It could be created by some teleprinters (such as
the Teletype), which used special characters to indicate ends of records.
The first text editors were "line editors" oriented to teleprinter- or typewriter-style terminals
without displays. Commands (often a single keystroke) effected edits to a file at an
imaginary insertion point called the "cursor". Edits were verified by typing a command to
print a small section of the file, and periodically by printing the entire file. In some line
editors, the cursor could be moved by commands that specified the line number in the file,
text strings (context) for which to search, and eventually regular expressions. Line editors
were major improvements over keypunching. Some line editors could be used by
keypunch; editing commands could be taken from a deck of cards and applied to a
specified file. Some common line editors supported a "verify" mode in which change
commands displayed the altered lines.
When computer terminals with video screens became available, screen-based text
editors (sometimes called just "screen editors") became common. One of the earliest full-
screen editors was O26, which was written for the operator console of the CDC 6000
series computers in 1967. Another early full-screen editor was vi. Written in the 1970s, it is
still a standard editor[5] on Unix and Linux operating systems. Also written in the 1970s was
the UCSD Pascal Screen Oriented Editor, which was optimized both for indented source
code as well as general text.[citation needed] Emacs, one of the first open source and free
software projects, is another early full-screen or real-time editor, one that was ported to
many systems.[6] A full-screen editor's ease-of-use and speed (compared to the line-based
editors) motivated many early purchases of video terminals.[7]
The core data structure in a text editor is the one that manages the string (sequence of
characters) or list of records that represents the current state of the file being edited. While
the former could be stored in a single long consecutive array of characters, the desire for
text editors that could more quickly insert text, delete text, and undo/redo previous edits led
to the development of more complicated sequence data structures.[8] A typical text editor
uses a gap buffer, a linked list of lines (as in PaperClip), a piece table, or a rope, as its
sequence data structure.

You might also like