feat: improve textbox editor behaviour
This commit is contained in:
@@ -397,6 +397,23 @@ func TestVimVisualModeDeletesAcrossSoftWrappedRows(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestVimVisualSubstituteDeletesSelectionAndEntersInsertMode(t *testing.T) {
|
||||
editor := newTextEditor("abcdef", true)
|
||||
editor.Cursor = 1
|
||||
editor.handleKey(runeKey("v"), false)
|
||||
editor.handleKey(runeKey("l"), false)
|
||||
editor.handleKey(runeKey("l"), false)
|
||||
editor.handleKey(runeKey("s"), false)
|
||||
|
||||
if editor.Text != "aef" || editor.Cursor != 1 || editor.Mode != textEditorInsert {
|
||||
t.Fatalf("visual substitute = %#v", editor)
|
||||
}
|
||||
editor.handleKey(runeKey("X"), false)
|
||||
if editor.Text != "aXef" || editor.Cursor != 2 {
|
||||
t.Fatalf("visual substitute insertion = %#v", editor)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVimVisualYankAndPasteUseSystemClipboardAbstraction(t *testing.T) {
|
||||
clipboard := &memoryTextClipboard{}
|
||||
editor := newTextEditor("abcdef", true)
|
||||
|
||||
Reference in New Issue
Block a user