Skip to content

Commit

Permalink
fix issule chzyer#169 for single line case
Browse files Browse the repository at this point in the history
  • Loading branch information
kinogmt committed Mar 13, 2019
1 parent 30ec85b commit 4ef58be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions runebuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ef58be

Please sign in to comment.