Fix CTRL-Y key binding

With tmux-based test cases
This commit is contained in:
Junegunn Choi
2015-01-17 04:55:29 +09:00
parent 62acb9adc4
commit ae3180f919
6 changed files with 209 additions and 12 deletions

View File

@@ -515,7 +515,8 @@ func (t *Terminal) Loop() {
t.rubout("[^[:alnum:]][[:alnum:]]")
}
case C.CtrlY:
t.input = append(append(t.input[:t.cx], t.yanked...), t.input[t.cx:]...)
suffix := copySlice(t.input[t.cx:])
t.input = append(append(t.input[:t.cx], t.yanked...), suffix...)
t.cx += len(t.yanked)
case C.Del:
t.delChar()