From 23a0332185281e61486fea54eeefca5f53cc0822 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 10 Aug 2019 15:27:32 +0100 Subject: [PATCH] config: don't offer hidden values for editing in the config - fixes #3416 --- fs/config/config.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/config/config.go b/fs/config/config.go index c618c3978..913138217 100644 --- a/fs/config/config.go +++ b/fs/config/config.go @@ -1072,12 +1072,13 @@ func editOptions(ri *fs.RegInfo, name string, isNew bool) { } } for _, option := range ri.Options { - hasAdvanced = hasAdvanced || option.Advanced + isVisible := option.Hide&fs.OptionHideConfigurator == 0 + hasAdvanced = hasAdvanced || (option.Advanced && isVisible) if option.Advanced != advanced { continue } subProvider := getConfigData().MustValue(name, fs.ConfigProvider, "") - if matchProvider(option.Provider, subProvider) { + if matchProvider(option.Provider, subProvider) && isVisible { if !isNew { fmt.Printf("Value %q = %q\n", option.Name, FileGet(name, option.Name)) fmt.Printf("Edit? (y/n)>\n") @@ -1085,9 +1086,7 @@ func editOptions(ri *fs.RegInfo, name string, isNew bool) { continue } } - if option.Hide&fs.OptionHideConfigurator == 0 { - FileSet(name, option.Name, ChooseOption(&option, name)) - } + FileSet(name, option.Name, ChooseOption(&option, name)) } } }