summaryrefslogtreecommitdiffstats
path: root/src/result.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-10-24 09:44:56 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-11-07 02:32:14 +0900
commit0c573b3dffe806253e1df2447754a5f3939a11f0 (patch)
tree1fba66a85b6ce48ff3afca18f234a0e0b6ff0822 /src/result.go
parent2cff00dce24df2a7e5add001423c6d8200b57c87 (diff)
Prepare for termbox/windows build
`TAGS=termbox make` (or `go build -tags termbox`)
Diffstat (limited to 'src/result.go')
-rw-r--r--src/result.go20
1 files changed, 10 insertions, 10 deletions
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)})
}
}
}