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

@@ -153,7 +153,7 @@ func (m *Messenger) YesNoPrompt(prompt string) (bool, bool) {
for {
m.Clear()
m.Display()
screen.ShowCursor(Count(m.message), h-1)
ShowCursor(Count(m.message), h-1)
screen.Show()
event := <-events
@@ -190,7 +190,7 @@ func (m *Messenger) LetterPrompt(prompt string, responses ...rune) (rune, bool)
for {
m.Clear()
m.Display()
screen.ShowCursor(Count(m.message), h-1)
ShowCursor(Count(m.message), h-1)
screen.Show()
event := <-events
@@ -470,7 +470,7 @@ func (m *Messenger) Display() {
}
if m.hasPrompt {
screen.ShowCursor(Count(m.message)+m.cursorx, h-1)
ShowCursor(Count(m.message)+m.cursorx, h-1)
screen.Show()
}
}