mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-18 14:57:18 +09:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user