]> git.lizzy.rs Git - micro.git/commitdiff
Fix bold highlighting not working right
authorZachary Yedidia <zyedidia@gmail.com>
Mon, 20 Feb 2017 14:28:37 +0000 (09:28 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Mon, 20 Feb 2017 14:28:37 +0000 (09:28 -0500)
cmd/micro/colorscheme.go

index 74e770181b181744a30a7d37b1b8c33df01cbb1f..f0c8adf2fd682beba699fe5f0688d18430f46b21 100644 (file)
@@ -107,7 +107,13 @@ func ParseColorscheme(text string) Colorscheme {
 // The 'extra' can be bold, reverse, or underline
 func StringToStyle(str string) tcell.Style {
        var fg, bg string
-       split := strings.Split(str, ",")
+       spaceSplit := strings.Split(str, " ")
+       var split []string
+       if len(spaceSplit) > 1 {
+               split = strings.Split(spaceSplit[1], ",")
+       } else {
+               split = strings.Split(str, ",")
+       }
        if len(split) > 1 {
                fg, bg = split[0], split[1]
        } else {