make keybinds configurable and consolidate
This commit is contained in:
@@ -16,6 +16,21 @@ type memoryTextClipboard struct {
|
||||
writeErr error
|
||||
}
|
||||
|
||||
func TestVimEditorUsesSharedConfiguredNavigation(t *testing.T) {
|
||||
editor := newTextEditor("first\nsecond", true)
|
||||
editor.keys.Navigation.Down = []string{"ctrl+j"}
|
||||
editor.keys.Navigation.Up = []string{"ctrl+k"}
|
||||
|
||||
editor.handleKey(runeKey("j"), true)
|
||||
if editor.Cursor != 0 {
|
||||
t.Fatalf("removed default j moved cursor to %d", editor.Cursor)
|
||||
}
|
||||
editor.handleKey(tea.KeyMsg{Type: tea.KeyCtrlJ}, true)
|
||||
if editor.Cursor != len([]rune("first\n")) {
|
||||
t.Fatalf("configured ctrl+j moved cursor to %d", editor.Cursor)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *memoryTextClipboard) ReadText() (string, error) {
|
||||
return c.text, c.readErr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user