name : TE description : Tiny Editor version : 1.7 date : Feb 20, 2000 O.S. : MS-DOS v3.2 Video adaptor : Monochrome, CGA, EGA usage : TE [filespec] author : J R Ferguson e-mail : j.r.ferguson @ iname.com download : http://hello.to/ferguson This program and its source may be used and copied freely without charge, but only for non-commercial purposes. The author is not responsible for any damage or loss of data that may be caused by using it. TE is a Tiny Editor, primarily meant for programmer's editing tasks. It uses a Wordstar like command scheme, also found in the Integrated Editors with Borland's Turbo Pascal and Turbo C. There are no extensive facilities for page layout or text formatting, although there is a word wrap function. On the other hand, the editor does have some extra's like undo, goto line number and the ability to repeat and move lines. Both the text file and the lines in it are limited to 64kb. The functionality is summarized as follows (^ prefix means Control key): ^E line up ^X line down ^S character left ^D character right ^R page up ^C page down ^ ^W scroll line up ^ ^Z scroll line down to start of line to end of line ^ ^QE to top of screen ^ ^QX to bottom of screen ^ ^QR to top of file ^ ^QC to end of file ^ ^A word left ^ ^F word right ^QS window left ^QD window right ^V toggle insert/overstrike mode ^G delete character at cursor ,^ ^H delete character left of cursor ^U abort current command ^JO Display text formatting status HELP ^J Display command summary O ^JO Display text formatting commands and status SAVE ^KS Save changes and resume edit LOAD Abandon changes and load new file EXIT ^KX Save changes and exit FIND ^QF Find text REPL ^QA Find and replace text BEGIN ^KB Mark begin block END ^KK Mark end block MARK LN ^KM Mark current line REPT LN ^K\ Repeat current line ^KA Move line up ^KZ Move line down ^Y Delete the current line ^QY Delete from cursor to end of line ^Q ^QH Delete to start of line ^QG Go to specified line number ^T delete word right ^N insert new line ^P insert next keystroke literal ^KH Hide/show marked block ^KC Copy marked block to current position ^KV Move marked block to current position ^KY Delete marked block ^KP Print marked block ^KR Read block from file ^KW Write marked block to file ^K] Trim lines in block (remove trailing blanks) ^KT Mark word at or left of cursor ^QU Undo character/word delete or replace ^QL Undelete line ^KU Undelete block ^L Repeat last find ^QV To position before last find ^QP To previous position ^Kn Set text marker n (n = '0'..'9') ^Qn To text marker n (n = '0'..'9') ^KQ Exit without saving changes ^KD file menu (Save, Load, New file, Quit, Exit) ^B reformat paragraph ^OW toggle word wrap on/off ^OL set left margin ^OR set right margin ^OI copy margins from current line ^OJ toggle justification on/off ^O] toggle trim mode on/off ^QI toggle auto-indent on/off ^OD change control character display With double control sequences (^QF, ^KX, etc) the second character may be lowercase, uppercase or control. The following find/replace options are supported: G : Start searching from top of text. Repeat replaces. U : Find both upper and lower case letters. N : Replace without questions. n : Repeat n times. The undo command (^QU) re-inserts characters that were lost by one of the following actions: - delete character at cursor - delete character left of cusor - delete word right - find and replace text - typing in overwrite mode It will only work if the cursor was not moved since, and buffers up to a maximum of 255 characters. The commands undelete line (^QL) and undelete block (^KU) will still work after cursor movement. Repeated execution inserts the same text again. This facility can be used as a cut/paste technique to copy and/or move texts, in addition to the standard Wordstar-style block copy/move commands. Although lines can be up to 65535 columns long, the line undelete buffer can hold a maximum of 255 characters. The block undelete buffer however has room for 64kb, matching the maximum size of the text file that can be edited. The editor has an insert and overstrike mode indicated by the letters "Ins" or "Ovr" at the right end of the status line. In this line you can also see the current line and column numbers and the name of the file you are currently editing. This name may be changed when you issue the save (^KS) or exit (^KX) command. A # sign in front of the filename indicates the text has been changed since the last load or save. The ^OD command rotates the control character display mode through its three states: CtrOff : no display Ctr^ : Wordstar style (^A, ^B, etc.) CtrLit : literal display In CtrLit and Ctr^ mode, end-of-line tokens are displayed in hightlight at the rightmost display column: - : CR < : CR-LF L : LF P : FF . : End-of-file + : The line has more characters beyond the right window boundary. When lines are terminated by hitting Return or Enter, a CR-LF pair is inserted. The following commands are related to word wrap and paragraph reformattig: - ^OL : Set left margin. ^OR : Set right margin. Press Esc to set the margin at the cursor position, enter the column number or press ^R to see the current setting. Press ^U to cancel the command. - ^OI : Copy margins from current line. The first and last non-blank character on the current line are copied as left and right margin. If the cursor is at a line consisting of only blanks (spaces or tabs), nothing is changed. - ^B : Reformat paragraph. Reformat a paragraph to fit between left and right margins, starting at the cursor location. An empty line is detected as the end of the paragraph. - ^OW : Toggle word wrap mode. When word wrap is activated, the left and right margins are automatically dealt with as you type in text. Word wrap mode de-activates auto-indent. - ^OJ : Toggle justification mode. Justification mode decides whether text reformatting and word wrap fills up the lines with spaces to meet the right margin. When justification is off, each word will be separated by exactly one space, discarding any other separators (spaces, tabs, newlines) that were originally found between the words. The trim mode can be toggled with the command ^O]. When this mode is on, all trailing spaces and tabs are removed from the current line when Return is pressed in insert mode. A related command is ^K], with which trailing blanks are removed from all lines within the current marked block, regardless of insert or overwrite mode. An auto-indent mode is provided that combines the functionality of the auto-indent mode, tab mode and unindent mode of Borland's integrated editors. It is toggled with the command ^QI. Auto-indent mode is de-activated when word wrap mode is on. When auto-indent is on and word wrap is off, three mechanisms are in effect that are specifically helpful in program source editing tasks: - Pressing Return or Enter will automatically insert as many spaces as needed to align the cursor under the first non-blank character in the previous line. - The tab or ^I key will align the cursor under the start of the next word on the first nonblank line above the cursor. In insert mode, spaces are inserted to align the cursor. In overwrite mode, the cursor is moved without changing the text. When no more word can be found to the right on the first nonblank line above the cursor, nothing happens. This is also the fact if no nonblank lines can be found above the cursor. The key sequence ^PI or ^P^I or ^P can be used to insert a literal tab character while in auto-indent mode. - The backspace or ^H key will unindent when there are only spaces and/or tab characters to the left of the cursor. This means that enough spaces and tabs left of the cursor are removed to position the cursor under the previous indentation level. In fact, all tabs to the left of the cursor are removed by the unindent action, and a new margin is inserted, consisting of spaces only. When the cursor is on a column position to the right of the first non-blank character on a line, the backspace key has its normal function to delete one character backward. The key sequences ^PH, ^P^H and ^P will NOT effect in the normal backspace function in this case. Those keystrokes will write a literal ^H character into the text, as they always do. History: v1.0 Jan 13,1992 First release v1.1 Jan 14,1992 Small enhancements and bug fixes v1.2 Jan 19,1992 Paragraph reformat v1.3 Jan 24,1992 Justification option v1.4 Mar 10,1992 Word wrap, auto-indent and trim facility v1.5 Aug 17,1992 Code cleanup, small enhancements v1.6 Jan 05,1993 Bug fixes v1.7 Feb 20,2000 Added author's Internet address. No program change.