From 0c573b3dffe806253e1df2447754a5f3939a11f0 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 24 Oct 2016 09:44:56 +0900 Subject: Prepare for termbox/windows build `TAGS=termbox make` (or `go build -tags termbox`) --- src/result.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/result.go') diff --git a/src/result.go b/src/result.go index 69e83f85..c0cf5d61 100644 --- a/src/result.go +++ b/src/result.go @@ -5,7 +5,7 @@ import ( "sort" "unicode" - "github.com/junegunn/fzf/src/curses" + "github.com/junegunn/fzf/src/tui" "github.com/junegunn/fzf/src/util" ) @@ -14,8 +14,8 @@ type Offset [2]int32 type colorOffset struct { offset [2]int32 - color int - attr curses.Attr + color tui.ColorPair + attr tui.Attr index int32 } @@ -92,7 +92,7 @@ func minRank() rank { return rank{index: 0, points: [4]uint16{math.MaxUint16, 0, 0, 0}} } -func (result *Result) colorOffsets(matchOffsets []Offset, theme *curses.ColorTheme, color int, attr curses.Attr, current bool) []colorOffset { +func (result *Result) colorOffsets(matchOffsets []Offset, theme *tui.ColorTheme, color tui.ColorPair, attr tui.Attr, current bool) []colorOffset { itemColors := result.item.Colors() // No ANSI code, or --color=no @@ -149,23 +149,23 @@ func (result *Result) colorOffsets(matchOffsets []Offset, theme *curses.ColorThe fg := ansi.color.fg if fg == -1 { if current { - fg = int(theme.Current) + fg = theme.Current } else { - fg = int(theme.Fg) + fg = theme.Fg } } bg := ansi.color.bg if bg == -1 { if current { - bg = int(theme.DarkBg) + bg = theme.DarkBg } else { - bg = int(theme.Bg) + bg = theme.Bg } } colors = append(colors, colorOffset{ offset: [2]int32{int32(start), int32(idx)}, - color: curses.PairFor(fg, bg), - attr: ansi.color.attr | attr}) + color: tui.PairFor(fg, bg), + attr: ansi.color.attr.Merge(attr)}) } } } -- cgit v1.2.3