Specifications for "ee" editor ----------------------------------------------- Contents 1. Overview 2. Startup Options 3. Editable Characters 4. End-of-file and End-of-Line 5. Tabs 6. Windows 7. Cursor Movement 8. Commands 9. Highlighted Blocks 10. Bookmarks 11. Global Status Bar 12. On-Line Help 13. Intentionally Omitted 1. Overview In order to ease the maintainability, the editor will address the basic needs of a programmer's editor, but not the features that only "would be nice". We may offer later an enhanced product that will be a "Windows" program, but the base version ( for the same reason ) will be a "console" application, which is also called a command-line, or "DOS-style" application. 2. Startup Options From the command line the editor can be started with one or more command-line parameters for the file or files to edit. The user can use wildcards also, as in "ee *.cpp *.h" . 3. Editable Characters The editor will handle 8-bit characters, and not try to handle Unicode. Horizontal tabs, end-of-file markers, and end-of-line markers ( ASCII 9, 26, 10, and 13 ) will be recognized when a file is read in, and treated as such. Other control characters will not get treated as having special meaning, but will also not cause problems. One consequence of note is, this editor will be able to edit files with embedded NUL ( ASCII 0 ) characters. 4. End-of-file and End-of-Line The last line in a file will end in an end-of-line marker when the file is saved, even if the file didn't have one when it was read in. This marker can be inserted before the save, e.g., when a file is first opened. We are not specifying the way the text is kept in memory; only what affects the user. The end-of-line marker in saved text will be a carriage-return followed by a line-feed ( ASCII 10 and 13 ), since we are aiming at the DOS / Windows world, rather than UNIX or Macintosh. But the editor will be able to read files with lines ending in just ASCII 10, or just ASCII 13. 5. Tabs Horizontal tabs will be converted to blanks on opening a file for editing. During editing, when in overwrite mode, the tab key will only move the cursor, but in insert mode it will insert blanks. 6. Windows The user will be able to have several files open at the same time, in separate windows, and also several windows open to the same file. The windows are considered to be on layers, which is sometimes called the z-order. Each layer is kept full, that is, the windows on a layer fill the screen, outside of the global status bar. So only the windows on the current layer are visible. Each window will have a status line that shows the name of the file being edited, the number of lines in the file, and the line and column numbers of the cursor position. The status line for each window will be the top line in a window, and will have the layout : columns 0 -> 38 file specification columns 41 -> 54 number of lines in the file, and then " lines" columns 56 -> 80 cursor position as "line ## column ##" If the file specification has more than 39 characters, then we will cut out the middle, so it starts like "C:\...", and ends with what fits from the right end. If the number of lines in the file has more than 8 digits, then we will show "********" . 7. Cursor Movement The cursor will be allowed past the end of a line, to the right. But it cannot be to the left of the start of a line. Also, it cannot be on a line past the last line in the file, or before the start of the file's text. We let the user "arrow" past the end-of-line, to the right, but not past the last line in the file, going downward. If the user asks for the cursor to move down, when it is on the bottom line of the window, the window 's text will scroll up one line ( or we could say, the window over the text moves down one line ), unless the cursor is at the end of the file. Similarly at the top of the window. If the cursor is at the right edge of the window, and has a request to move to the right, the window text will scroll 1/3 of a window width to the left( or we could say the window moved to the right, over the text ) . Similarly at the left edge of the window, unless the window is as far left as possible. If a block is deleted that contains the cursor position, the cursor should move to the first character after the block. If the block went to the end of the file, the cursor moves to the first character before the block. If the block was the entire file, the cursor moves to the one end-of-line that we always preserve. When a window is made active, the cursor should appear in the expected place. If the window has never been active, that place is the start of the file. If the window was active, the cursor should appear where it was, unless some change has moved the cursor. In an inactive window, the "position where the cursor would be" changes on a text insertion or deletion by the same rules as the cursor position in the active window. The window will keep the "position where the cursor would be" visible. 8. Commands There will be commands for the following. Cursor Movement group : go to the beginning of the line go to the end of the line move one word right move one word left go to the top of the screen go to the bottom of the screen go to the beginning of the file go to the end of the file go to a specified line number go to balancing parenthesis Find / Replace group find forward repeat find forward replace forward find backward repeat find backward replace backward toggle case sensitivity Line group delete a line add a line split a line join two lines duplicate a line delete to end-of-line Block group mark start or end of a line block mark start or end of a column block unmark a block delete a block copy a block copy a block and unmark it move a block overlay a block fill a column block with a specified character write a block to a file File group save save and exit exit, but ask whether to save changes save as edit a new file Window group move to next window move to previous window resize window split window scroll up scroll down Miscellaneous group show help show an ASCII chart toggle indent mode set edit tabs set a book mark go to a book mark split a window and edit another file quit a file show end-of-line characters ( show credits ) Help and ASCII group next screen previous screen exit 9. Highlighted Blocks We will have two types of highlighted blocks : A. a "line block" : a sequence of consecutive lines B. a "column block" : a rectangular area, from one line to another, and from one column to another. This type of block can extend past the end of some of the lines in it. If lines 10 -> 20 are marked as a block, and the user deletes all the characters in line 15, including the eol, the block would then be one line shorter. I.e., the block would then be lines 10 -> 19 ( 19 being the former 20 ). 10. Bookmarks Each file will be allowed one possible bookmark. 11. Global Status Bar There will be one overall status line that shows the number of files open, whether case sensitivity in searching is on or off, and whether insert mode is on or off. The overall status line will be the last line on the screen, and have the layout columns 0 -> 13 number of files opened, and then " file" or " files" columns 17 -> 33 edit tab size columns 37 -> 53 read tab size columns 57 -> 67 "match case " or "ignore case", right-justified columns 71 -> 79 "overwrite" or "insert", right justified These are details of the layout. In the "longest content", a blank is represented by an underscore. value columns size longest content file count 0 -> 13 14 99999999_files spacing 14 -> 16 3 ___ edit tab size 17 -> 33 17 edit_tab_size=_99 spacing 34 -> 36 3 ___ read tab size 37 -> 53 17 read_tab_size=_99 spacing 54 -> 56 3 ___ case sensitive 57 -> 67 11 ignore_case spacing 68 -> 70 3 ___ insert-overwrite 71 -> 79 9 overwrite If the "edit tab size" or "read tab size" has only one digit, we'll put a blank before the equals sign. If the number of files opened has more than 8 digits, then we'll show "********" . 12. On-Line Help There will be on-line help available, an ASCII chart, and a "credits" screen. 13. Intentionally Omitted These are some features that "would be nice", but for simplicity were intentionally left out. Of course, this list is potentially endless. A. More bookmarks. B. Let the user choose a file to edit with a standard Windows dialog. C. An automatic indentation option. D. A command history, so "Undo" is possible. E. Save files automatically at given time intervals. F. An end-of-file indicator on screen.