diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2017-01-11 22:13:40 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-01-11 22:13:40 +0900 |
| commit | 9977a3e9fcdc2d2feda2f8cd2990a89c21804e56 (patch) | |
| tree | 9a4657c2bb6733dfd3304f7531aa51cae66c4b6f /src/tui/ncurses.go | |
| parent | f8082bc53a5bc736558d5952a34b527f12815878 (diff) | |
| download | fzf-9977a3e9fcdc2d2feda2f8cd2990a89c21804e56.tar.gz | |
Make preview renderer suspend early on line wrap
Diffstat (limited to 'src/tui/ncurses.go')
| -rw-r--r-- | src/tui/ncurses.go | 9 |
1 files changed, 6 insertions, 3 deletions
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)) |
