Allow put action with an argument i.e. put(...)

This commit is contained in:
Junegunn Choi
2022-12-27 19:54:46 +09:00
parent 12af069dca
commit 4b3f0b9f08
5 changed files with 24 additions and 1 deletions

View File

@@ -321,6 +321,7 @@ const (
actPreviewHalfPageDown
actPrevHistory
actPrevSelected
actPut
actNextHistory
actNextSelected
actExecute
@@ -2848,6 +2849,11 @@ func (t *Terminal) Loop() {
t.vset(n)
req(reqList)
}
case actPut:
str := []rune(a.a)
suffix := copySlice(t.input[t.cx:])
t.input = append(append(t.input[:t.cx], str...), suffix...)
t.cx += len(str)
case actUnixLineDiscard:
beof = len(t.input) == 0
if t.cx > 0 {