Skip to content

Commit

Permalink
Remove config, make default sort order descending
Browse files Browse the repository at this point in the history
  • Loading branch information
rverst authored and jesseduffield committed Jun 5, 2021
1 parent 472288c commit 94b52af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion docs/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ gui:
showRandomTip: true
showCommandLog: true
commandLogSize: 8
sortTagsDescending: false # sort order for tags
git:
paging:
colorArg: always
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/loading_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func (c *GitCommand) GetTags() ([]*models.Tag, error) {
// now lets sort our tags by name numerically
re := regexp.MustCompile(semverRegex)

sortAsc := !c.Config.GetUserConfig().Gui.SortTagsDescending
// the reason this is complicated is because we're both sorting alphabetically
sortAsc := c.Config.GetUserConfig().Gui.SortTagsAscending
// the reason this is complicated is because we're both sorting alphabetically
// and when we're dealing with semver strings
sort.Slice(tags, func(i, j int) bool {
var a, b string
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/user_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type GuiConfig struct {
ShowRandomTip bool `yaml:"showRandomTip"`
ShowCommandLog bool `yaml:"showCommandLog"`
CommandLogSize int `yaml:"commandLogSize"`
SortTagsDescending bool `yaml:"sortTagsDescending"`
SortTagsAscending bool `yaml:"sortTagsAscending"`
}

type ThemeConfig struct {
Expand Down Expand Up @@ -308,7 +308,7 @@ func GetDefaultConfig() *UserConfig {
ShowFileTree: false,
ShowRandomTip: true,
CommandLogSize: 8,
SortTagsDescending: false,
SortTagsAscending: false,
},
Git: GitConfig{
Paging: PagingConfig{
Expand Down

0 comments on commit 94b52af

Please sign in to comment.