Editors or text editors are software programs that enable the user to create and edit text files. In the field of programming, the term editor usually refers to source code editors that include many special features for writing and editing code. Notepad, Wordpad are some of the common editors used on Windows OS and vi, emacs, Jed, pico are the editors on UNIX OS. Features normally associated with text editors are — moving the cursor, deleting, replacing, pasting, finding, finding and replacing, saving etc.
Types of Editors
There are generally five types of editors as described below:
- Line editor: In this, you can only edit one line at a time or an integral number of lines. You cannot have a free-flowing sequence of characters. It will take care of only one line.
Ex : Teleprinter, edlin, teco
- Stream editors: In this type of editors, the file is treated as continuous flow or sequence of characters instead of line numbers, which means here you can type paragraphs.
Ex : Sed editor in UNIX - Screen editors: In this type of editors, the user is able to see the cursor on the screen and can make a copy, cut, paste operation easily. It is very easy to use mouse pointer.
Ex : vi, emacs, Notepad - Word Processor: Overcoming the limitations of screen editors, it allows one to use some format to insert images, files, videos, use font, size, style features. It majorly focuses on Natural language.
- Structure Editor: Structure editor focuses on programming languages. It provides features to write and edit source code.
Ex : Netbeans IDE, gEdit.
Some other editors:
- Full Screen Editors: In computers, a full-screen editor or distraction-free editor is a text editor that occupies full display with the purpose of sidelining the user from the OS and the other applications. It helps the user to focus on writing only and do not get distracted by the other applications and the cluttered interface. Often fullscreen editors has a dark background and a text field with a light colored text. They include customizable interfaces and feature like word count.
Ex : Acme, Coderoom, FocusWriter - Multiple Window Editor: Multiple window editor allows you to work on more than one file at a time and cut and paste text from file into another via yanking and putting. The two fundamental concepts that lie behind multi-window editors are buffer and windows.
Buffer: Buffer holds the text to be edited. The text may come from a file or a brand new text that you want to write on a file. A file only has one buffer associated with it.
Windows: Windows provides a view to the buffer to see what the buffer holds and edit and modify it. A buffer may have multiple windows. Any changes made in any of the windows will be reflected in all other windows associated with the same buffer. Once the last window associated with a buffer is closed, the file gets hidden. But if you have made any changes to the buffer and not have written them into the disk, it may not allow you to close the window.
- DOS-Editor: MS-DOS editor or sometimes also known as just edit is a character based text editor that comes with MS-DOS and a 32-bit version of windows. Previously, it was QBASIC running in editor mode but after DOS-7, it became a standalone program. It is also used as a substitute for Notepad since notepad can work only on small files, DOS editor can work on around 66, 257 lines and up to 5 MB file size. It has features like a customizable color theme, it can open up to 9 files at a time, it can open files in binary mode.
- VI editor : The vi editor (short name for the visual editor) is a screen editor which is available in UNIX OS. Vi has no menus instead it uses a combination of keystrokes to accomplish tasks. An improved version of vi is vim(vi improved). Vi editor is usually available in all versions of UNIX OS, its implementation is very easy, it requires only a few resources and it is more user-friendly.
- Online Editors: Online text editors is an interface for editing the texts within a web browser. It aims to reduce the efforts made by the user by directly editing and updating into a valid HTML markup language. Internet Explorer added first the feature of “design mode”. The design mode allows the user to edit their document and it also allows the use of the cursor to do the editing.
Ex : CKEditor, SnapEditor, designmode by Internet Explorer.
Editing Process
We all by now understand that editors are the program which is used to create, edit and modify a document. A document may include some images, files, text, equations, and diagrams as well. But we will be limited to text editors only whose main elements are character strings.
The document editing process mainly compromises of the following four tasks :
- The part of the document to edited or modifies is selected.
- determining how to format this lines on view and how to display it.
- Specify and execute the operations that modify the document.
- Update the view properly.
The above steps include filtering, formatting, and traveling.
- Formatting : Visibility on display screen.
- Filtering : Finding out the main/important subset.
- Traveling : Locating the area of interest.
User Interface of editors: The user interface of editors typically means the input, output and the interaction language. The input devices are used to enter text, data into a document or to process commands. The output devices are used to display the edited form of the document and the results of the operation/commands executed. The interaction language provides the interaction with the editor.
- Input Devices : Input devices are generally divided as text input, button devices and locator devices. Text device is a keyboard. Button devices are special function keys. The locator devices include the mouse. There are special voice devices as well which writes into text whatever you speak.
- Output Devices : TFT monitors, Printers, Teletypewriters, Cathode ray tube technology, Advanced CRT terminals.
- Interaction language : The interaction language could be, typing oriented or text command-oriented or could be menu oriented user interface as well. Typing or text command-oriented interaction language is very old used with the oldest editors, in the form of commands, use of functions and control keys etc. Menu oriented interface has a menu with the set of multiple choice of text strings. The display area is limited and the menus can be turned on/off by the user.
Editor Structure
The command language processor accepts commands, performs functions such as editing and viewing. It involves traveling, editing, viewing and display. Editing operations are specified by the user and display operations are specified by the editor. Traveling and viewing components are invoked by the editor or the user itself during the operations.
Editing component is a module dealing with editing tasks. The current editing area is determined by the current editing pointer associated with the editing component. When editing command is made, the editing component calls the editing filter, generates a new editing buffer. Editing buffer contains the document to be edited at the current editor pointer location.
In viewing a document, the start of the area to be viewed is determined by the current viewing pointer. Viewing component is a collection of modules used to see the next view. Current viewing can be made to set or reset depending upon the last operation.
When display needs to be updated, the viewing component invokes the viewing filter, generates a new buffer and it contains the document to be viewed using the current view buffer. Then the viewing buffer is pass to the display component which produces the display by buffer mapping. The editing and viewing buffers may be identical or completely disjoint. The editing and viewing buffers can also partially overlap or can be contained one within the another. The component of the editor interacts with the document from the user on two levels: main memory and the disk files system.