Add multiple cursor support

This commit creates new keybindings and actions to handle multiple
cursors.

Here are the defaults:

    "Alt-n": "SpawnMultiCursor",
    "Alt-p": "RemoveMultiCursor",
    "Alt-c": "RemoveAllMultiCursors",
    "Alt-x": "SkipMultiCursor",
This commit is contained in:
Zachary Yedidia
2017-06-12 12:10:22 -04:00
parent 37ad137012
commit c45ff4dd4f
5 changed files with 289 additions and 132 deletions

View File

@@ -28,7 +28,8 @@ type Buffer struct {
// This stores all the text in the buffer as an array of lines
*LineArray
Cursor Cursor
Cursor Cursor
cursors []*Cursor // for multiple cursors
// Path to the file on disk
Path string
@@ -169,6 +170,8 @@ func NewBuffer(reader io.Reader, size int64, path string) *Buffer {
file.Close()
}
b.cursors = []*Cursor{&b.Cursor}
return b
}