From c89ef8b84a9759209c1f4a1f3a4d6cdb211c04f4 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 14 Oct 2023 15:32:03 +0200 Subject: [PATCH] Make it possible to set the nerd fonts version to "off" We don't need this for production code, but it will be needed for tests in the next commit. --- pkg/gui/presentation/icons/icons.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/gui/presentation/icons/icons.go b/pkg/gui/presentation/icons/icons.go index fbfc9bb07..6bb031dc2 100644 --- a/pkg/gui/presentation/icons/icons.go +++ b/pkg/gui/presentation/icons/icons.go @@ -13,14 +13,18 @@ func IsIconEnabled() bool { } func SetNerdFontsVersion(version string) { - if !lo.Contains([]string{"2", "3"}, version) { - log.Fatalf("Unsupported nerdFontVersion %s", version) - } + if version == "" { + isIconEnabled = false + } else { + if !lo.Contains([]string{"2", "3"}, version) { + log.Fatalf("Unsupported nerdFontVersion %s", version) + } - if version == "2" { - patchGitIconsForNerdFontsV2() - patchFileIconsForNerdFontsV2() - } + if version == "2" { + patchGitIconsForNerdFontsV2() + patchFileIconsForNerdFontsV2() + } - isIconEnabled = true + isIconEnabled = true + } }