From 4ef58bee6015eec1c8099e3dc2d2c131db56a665 Mon Sep 17 00:00:00 2001 From: Satoshi Kinoshita Date: Wed, 13 Mar 2019 16:15:41 +0900 Subject: [PATCH] fix issule #169 for single line case --- operation.go | 2 +- runebuf.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/operation.go b/operation.go index 4c31624..a5f32fa 100644 --- a/operation.go +++ b/operation.go @@ -385,7 +385,7 @@ func (o *Operation) Runes() ([]rune, error) { listener.OnChange(nil, 0, 0) } - o.buf.Refresh(nil) // print prompt + o.buf.PrintPrompt() // print prompt o.t.KickRead() select { case r := <-o.outchan: diff --git a/runebuf.go b/runebuf.go index 1e054c0..4e4627c 100644 --- a/runebuf.go +++ b/runebuf.go @@ -471,6 +471,12 @@ func (r *RuneBuffer) SetOffset(offset string) { r.Unlock() } +func (r *RuneBuffer) PrintPrompt() { + r.Lock() + r.print() + r.Unlock() +} + func (r *RuneBuffer) print() { r.w.Write(r.output()) r.hadClean = false