1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-13 11:50:28 +02:00

bump dependencies

This commit is contained in:
Jesse Duffield 2018-08-18 13:54:39 +10:00
parent 284c534251
commit 6b150a4be0
5 changed files with 80 additions and 27 deletions

18
Gopkg.lock generated
View File

@ -155,6 +155,14 @@
pruneopts = "NUT"
revision = "58046073cbffe2f25d425fe1331102f55cf719de"
[[projects]]
branch = "master"
digest = "1:5fe20cfe4ef484c237cec9f947b2a6fa90bad4b8610fd014f0e4211e13d82d5d"
name = "github.com/mitchellh/mapstructure"
packages = ["."]
pruneopts = "NUT"
revision = "f15292f7a699fcc1a38a80977f80a046874ba8ac"
[[projects]]
digest = "1:2c34c77bf3ec848da26e48af58fc511ed52750961fa848399d122882b8890928"
name = "github.com/nicksnyder/go-i18n"
@ -167,14 +175,6 @@
revision = "a16b91a3ba80db3a2301c70d1d302d42251c9079"
version = "v2.0.0-beta.5"
[[projects]]
branch = "master"
digest = "1:5fe20cfe4ef484c237cec9f947b2a6fa90bad4b8610fd014f0e4211e13d82d5d"
name = "github.com/mitchellh/mapstructure"
packages = ["."]
pruneopts = "NUT"
revision = "f15292f7a699fcc1a38a80977f80a046874ba8ac"
[[projects]]
branch = "master"
digest = "1:34d9354c2c5d916c05864327553047df59fc10e86ff1f408e4136eba0a25a5ec"
@ -438,9 +438,9 @@
"github.com/golang-collections/collections/stack",
"github.com/jesseduffield/gocui",
"github.com/mgutz/str",
"github.com/nicksnyder/go-i18n/v2/i18n",
"github.com/shibukawa/configdir",
"github.com/spf13/viper",
"github.com/nicksnyder/go-i18n/v2/i18n",
"github.com/tcnksm/go-gitconfig",
"golang.org/x/text/language",
"gopkg.in/src-d/go-git.v4",

39
docs/Config.md Normal file
View File

@ -0,0 +1,39 @@
# User Config:
## Default:
```
gui:
# stuff relating to the UI
scrollHeight: 2 # how many lines you scroll by
theme:
activeBorderColor:
- white
- bold
inactiveBorderColor:
- white
optionsTextColor:
- blue
git:
# stuff relating to git
os:
# stuff relating to the OS
```
## Color Attributes:
For color attributes you can choose an array of attributes (with max one color attribute)
The available attributes are:
- default
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- bold
- reverse # useful for high-contrast
- underline

View File

@ -2,8 +2,6 @@ package config
import (
"bytes"
"log"
"os/user"
"github.com/shibukawa/configdir"
"github.com/spf13/viper"
@ -117,7 +115,9 @@ func LoadUserConfigFromFile(v *viper.Viper) error {
if folder == nil {
// create the file as an empty config and load it
folders := configDirs.QueryFolders(configdir.Global)
folders[0].WriteFile("config.yml", []byte{})
if err := folders[0].WriteFile("config.yml", []byte{}); err != nil {
return err
}
folder = configDirs.QueryFolderContainsFile("config.yml")
}
v.AddConfigPath(folder.Path)
@ -150,11 +150,14 @@ func getDefaultConfig() []byte {
gui:
## stuff relating to the UI
scrollHeight: 2
activeBorderColor:
- white
- bold
inactiveBorderColor:
- white
theme:
activeBorderColor:
- white
- bold
inactiveBorderColor:
- white
optionsTextColor:
- blue
git:
# stuff relating to git
os:
@ -163,10 +166,11 @@ func getDefaultConfig() []byte {
`)
}
func homeDirectory() string {
usr, err := user.Current()
if err != nil {
log.Fatal(err)
}
return usr.HomeDir
}
// // commenting this out until we use it again
// func homeDirectory() string {
// usr, err := user.Current()
// if err != nil {
// log.Fatal(err)
// }
// return usr.HomeDir
// }

View File

@ -231,8 +231,10 @@ func (gui *Gui) layout(g *gocui.Gui) error {
if err != gocui.ErrUnknownView {
return err
}
v.FgColor = gocui.ColorBlue
v.Frame = false
if v.FgColor, err = gui.GetOptionsPanelTextColor(); err != nil {
return err
}
}
if gui.getCommitMessageView(g) == nil {

View File

@ -36,10 +36,18 @@ func (gui *Gui) GetColor(keys []string) gocui.Attribute {
return attribute
}
// GetOptionsPanelTextColor gets the color of the options panel text
func (gui *Gui) GetOptionsPanelTextColor() (gocui.Attribute, error) {
userConfig := gui.Config.GetUserConfig()
optionsColor := userConfig.GetStringSlice("gui.theme.optionsTextColor")
return gui.GetColor(optionsColor), nil
}
// SetColorScheme sets the color scheme for the app based on the user config
func (gui *Gui) SetColorScheme() error {
activeBorderColor := gui.Config.GetUserConfig().GetStringSlice("gui.activeBorderColor")
inactiveBorderColor := gui.Config.GetUserConfig().GetStringSlice("gui.inactiveBorderColor")
userConfig := gui.Config.GetUserConfig()
activeBorderColor := userConfig.GetStringSlice("gui.theme.activeBorderColor")
inactiveBorderColor := userConfig.GetStringSlice("gui.theme.inactiveBorderColor")
gui.g.FgColor = gui.GetColor(inactiveBorderColor)
gui.g.SelFgColor = gui.GetColor(activeBorderColor)
return nil