From c1b3597b8cc95a8ca2f91e993e4d978c395a5a99 Mon Sep 17 00:00:00 2001 From: cyberme0w Date: Sat, 16 Mar 2024 12:21:14 +0000 Subject: [PATCH] Add config option to disable auto-expanding folders (#367) --- cmd/guilds_tree.go | 1 + internal/config/config.go | 1 + internal/config/config.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/cmd/guilds_tree.go b/cmd/guilds_tree.go index 27337ff..346441a 100644 --- a/cmd/guilds_tree.go +++ b/cmd/guilds_tree.go @@ -53,6 +53,7 @@ func (gt *GuildsTree) createGuildFolderNode(parent *tview.TreeNode, gf gateway.G } n := tview.NewTreeNode(name) + n.SetExpanded(cfg.Theme.GuildsTree.AutoExpandFolders) parent.AddChild(n) for _, gid := range gf.GuildIDs { diff --git a/internal/config/config.go b/internal/config/config.go index 6b1d399..ffd2213 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -66,6 +66,7 @@ type Config struct { BackgroundColor string `yaml:"background_color"` GuildsTree struct { + AutoExpandFolders bool `yaml:"auto_expand_folders"` Graphics bool `yaml:"graphics"` } `yaml:"guilds_tree"` diff --git a/internal/config/config.yml b/internal/config/config.yml index 3919cb0..90ec249 100644 --- a/internal/config/config.yml +++ b/internal/config/config.yml @@ -49,6 +49,7 @@ theme: background_color: default guilds_tree: + auto_expand_folders: true graphics: true messages_text: