We don't have to clear the screen every time, we only have to make sure
that we erase the rest of the line that used to be on the current line.
We can still optimize a bit more by finding the longest line and drawing
to that length, but using the full width is fine for now.
We use a diff to be able to transform the buffer into an arbitrary
string (usually when we reread the file after an external program such
as gofmt has changed it) and still preserve undo/redo.
Fixes#136
Plugins can now create their own commands using the `MakeCommand`
function. Plugins can also now create their own keybindings with the
`BindKey` function. See the go plugin for an example of `MakeCommand`.
This adds the `savecursor` option which will remember where the cursor
was when the file was closed and put it back when the file is opened
again. The option is off by default so that people aren't confused as to
why the cursor isn't at the start of a file when they open it.
This commit also adds a more general ability to serialize a buffer so
various components can be saved (which could also be useful for persistent
undo).
Fixes#107
This commit puts in place the ability for multiple views (splits).
This commit also removes the editor bindings so that all bindings can be
rebound by the user.
I also added some more comments
This fixes#109
This lets you bind keys like Alt-b or Alt-f.
This commit also adds some new default keybindings in emacs style, so
alt-a is beginning of line and alt-e is end etc...
This is better design because the cursor and eventhandler are things the
buffer should know about directly but the view shouldn't. This should
make it easier to add persistent undo or location saving between
sessions (see #107).