Labs/Thunderhead/TheBook/Editor
From MozillaWiki
< Labs | Thunderhead | TheBook
The editor is a component that allows displaying and editing text.
Contents
Some Definitions
There are certain points in which semantics would be very important, so I'll lay out the terms I use and what I mean when I use them:
- Row: If a document is considered as a single string, then a row would be any substring between two EOL characters (with the exception of the first row which is from the beginning of the file and the first EOL, and the last row which is between the last EOL and the EOF).
- Line: Once a document is rendered onto the screen, rows could be broken into lines.
- Cursor: A logical location inside the model. The cursor is composed of a row number and a column.
- Caret: The cursor's representation in the view. The caret is composed of the top-left position of the caret, and the caret sprite.