mirror of
https://github.com/peco/peco.git
synced 2026-09-15 01:36:15 -04:00
Introduce matched style
This commit is contained in:
parent
675bb8b7c0
commit
772d804c25
|
|
@ -77,6 +77,7 @@ type StyleSet struct {
|
|||
SavedSelection Style `json:"SavedSelection"`
|
||||
Selected Style `json:"Selected"`
|
||||
Query Style `json:"Query"`
|
||||
Matched Style `json:"Matched"`
|
||||
}
|
||||
|
||||
func NewStyleSet() StyleSet {
|
||||
|
|
@ -84,7 +85,8 @@ func NewStyleSet() StyleSet {
|
|||
Basic: Style{fg: termbox.ColorDefault, bg: termbox.ColorDefault},
|
||||
SavedSelection: Style{fg: termbox.ColorBlack | termbox.AttrBold, bg: termbox.ColorCyan},
|
||||
Selected: Style{fg: termbox.ColorDefault | termbox.AttrUnderline, bg: termbox.ColorMagenta},
|
||||
Query: Style{fg: termbox.ColorCyan, bg: termbox.ColorDefault},
|
||||
Query: Style{fg: termbox.ColorDefault, bg: termbox.ColorDefault},
|
||||
Matched: Style{fg: termbox.ColorCyan, bg: termbox.ColorDefault},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ func TestReadRC(t *testing.T) {
|
|||
"Style": {
|
||||
"Basic": ["on_default", "default"],
|
||||
"Selected": ["underline", "on_cyan", "black"],
|
||||
"Query": ["yellow", "bold"]
|
||||
"Query": ["yellow", "bold"],
|
||||
"Matched": ["cyan", "bold", "on_red"]
|
||||
}
|
||||
}
|
||||
`
|
||||
|
|
|
|||
2
view.go
2
view.go
|
|
@ -233,7 +233,7 @@ CALCULATE_PAGE:
|
|||
index += len(c)
|
||||
}
|
||||
c := line[m[0]:m[1]]
|
||||
printTB(prev, n, v.config.Style.Query.fg, bgAttr|v.config.Style.Query.bg, c)
|
||||
printTB(prev, n, v.config.Style.Matched.fg, bgAttr|v.config.Style.Matched.bg, c)
|
||||
prev += runewidth.StringWidth(c)
|
||||
index += len(c)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue