From 9977a3e9fcdc2d2feda2f8cd2990a89c21804e56 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 11 Jan 2017 22:13:40 +0900 Subject: Make preview renderer suspend early on line wrap --- src/tui/ncurses.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/tui/ncurses.go') diff --git a/src/tui/ncurses.go b/src/tui/ncurses.go index f6feefc6..3e636ba2 100644 --- a/src/tui/ncurses.go +++ b/src/tui/ncurses.go @@ -282,11 +282,14 @@ func (r *FullscreenRenderer) DoesAutoWrap() bool { return true } -func (w *CursesWindow) Fill(str string) bool { - return C.waddstr(w.impl, C.CString(str)) == C.OK +func (w *CursesWindow) Fill(str string) FillReturn { + if C.waddstr(w.impl, C.CString(str)) == C.OK { + return FillContinue + } + return FillSuspend } -func (w *CursesWindow) CFill(fg Color, bg Color, attr Attr, str string) bool { +func (w *CursesWindow) CFill(fg Color, bg Color, attr Attr, str string) FillReturn { index := ColorPair{fg, bg, -1}.index() C.wcolor_set(w.impl, C.short(index), nil) C.wattron(w.impl, C.int(attr)) -- cgit v1.2.3