Everybody writes a screen editor. It's easy to do and makes them feel important. Tell them to work on something useful.
— Rob Pike (source)
Tell them to work on something useful.
... Nah.
A text editor, for fun and knowledge.
Based on the excellent Build Your Own Text Editor series. Most of the current code is a direct port of this tutorial.
A whimsical list of improvements I'd like to implement-
- Line numbers
- Mouse events
- Simple cursor movement
- Drag to highlight
- Cursor position history (this)
- Undo and redo
- Cut, copy, and paste
- Represent modifications using a Piece Table data structure
- Word wrapping (Rust's
std::fmt
should make this easy)