import (
"fmt"
- "github.com/gdamore/tcell"
- "github.com/mitchellh/go-homedir"
+ "github.com/zyedidia/tcell"
"io/ioutil"
"regexp"
"strconv"
// The current colorscheme
var colorscheme Colorscheme
-var preInstalledColors = [3]string{"default", "solarized", "solarized-tc"}
+var preInstalledColors = []string{"default", "solarized", "solarized-tc", "atom-dark-tc", "monokai"}
// InitColorscheme picks and initializes the colorscheme when micro starts
func InitColorscheme() {
LoadDefaultColorscheme()
}
-// LoadDefaultColorscheme loads the default colorscheme from ~/.micro/colorschemes
+// LoadDefaultColorscheme loads the default colorscheme from $(configDir)/colorschemes
func LoadDefaultColorscheme() {
- dir, err := homedir.Dir()
- if err != nil {
- TermMessage("Error finding your home directory\nCan't load runtime files")
- return
- }
- LoadColorscheme(settings.Colorscheme, dir+"/.micro/colorschemes")
+ LoadColorscheme(settings["colorscheme"].(string), configDir+"/colorschemes")
}
// LoadColorscheme loads the given colorscheme from a directory
data, err := Asset("runtime/colorschemes/" + name + ".micro")
if err != nil {
TermMessage("Unable to load pre-installed colorscheme " + name)
+ continue
}
colorscheme = ParseColorscheme(string(data))
}
fg = strings.TrimSpace(fg)
bg = strings.TrimSpace(bg)
- style := tcell.StyleDefault.Foreground(StringToColor(fg)).Background(StringToColor(bg))
+ style := defStyle.Foreground(StringToColor(fg)).Background(StringToColor(bg))
if strings.Contains(str, "bold") {
style = style.Bold(true)
}