This is a bit challenging even probably for a team project, let alone for a one-man implementation, but I was trying to put together a simple yet elegant text editor with syntax
RSyntaxTextArea is BSD licensed and supports your requirements, plus code folding and more. Very simple to use.