Last active
August 29, 2015 14:04
-
-
Save uobikiemukot/28c66567a6bd6edeac48 to your computer and use it in GitHub Desktop.
support bold background color to peco (https://github.com/peco/peco)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- config.go.orig 2014-07-21 15:25:16.623568026 +0900 | |
+++ config.go 2014-07-21 15:34:48.431977514 +0900 | |
@@ -76,11 +76,14 @@ | |
"on_cyan": termbox.ColorCyan, | |
"on_white": termbox.ColorWhite, | |
} | |
- stringToAttr = map[string]termbox.Attribute{ | |
+ stringToFgAttr = map[string]termbox.Attribute{ | |
"bold": termbox.AttrBold, | |
"underline": termbox.AttrUnderline, | |
"blink": termbox.AttrReverse, | |
} | |
+ stringToBgAttr = map[string]termbox.Attribute{ | |
+ "on_bold": termbox.AttrBold, | |
+ } | |
) | |
// StyleSet holds styles for various sections | |
@@ -138,9 +141,14 @@ | |
} | |
for _, s := range raw { | |
- attr, ok := stringToAttr[s] | |
+ fg_attr, ok := stringToFgAttr[s] | |
+ if ok { | |
+ style.fg |= fg_attr | |
+ } | |
+ | |
+ bg_attr, ok := stringToBgAttr[s] | |
if ok { | |
- style.fg |= attr | |
+ style.bg |= bg_attr | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment