diff --git a/operation.go b/operation.go index 14ade31..2c93561 100644 --- a/operation.go +++ b/operation.go @@ -32,6 +32,10 @@ type Operation struct { *opVim } +func (o *Operation) SetBuffer(what string) { + o.buf.Set([]rune(what)) +} + type wrapWriter struct { r *Operation t *Terminal diff --git a/readline.go b/readline.go index 3f02a83..b0242f7 100644 --- a/readline.go +++ b/readline.go @@ -242,6 +242,11 @@ func (i *Instance) Readline() (string, error) { return i.Operation.String() } +func (i *Instance) ReadlineWithDefault(what string) (string, error) { + i.Operation.SetBuffer(what) + return i.Operation.String() +} + func (i *Instance) SaveHistory(content string) error { return i.Operation.SaveHistory(content) }