Porting gedit to the terminal, a branch from Sanos simple text editor.
I branched this code from http://www.jbox.dk/sanos/editor.htm. Original copyright notice in https://github.com/lewish/tedit/blob/master/ORIGINAL_COPYRIGHT, as I have since refactored source. This applies to all code.