From 9be546d6c72d152ecba61cbd4f9ee542abfdf0cd Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 30 Sep 2025 09:50:29 +0800 Subject: [PATCH] Fix ShowOnlyMostUsedCMDsNumber default value --- Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs index 6433179f0..e89ec376c 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs @@ -384,9 +384,15 @@ namespace Flow.Launcher.Plugin.Shell Context = context; _settings = context.API.LoadSettingJsonStorage(); context.API.RegisterGlobalKeyboardCallback(API_GlobalKeyboardEvent); + // Since the old Settings class set default value of ShowOnlyMostUsedCMDsNumber to 0 which is a wrong value, + // we need to fix it here to make sure the default value is 5 + if (_settings.ShowOnlyMostUsedCMDsNumber == 0) + { + _settings.ShowOnlyMostUsedCMDsNumber = 5; + } } - bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state) + private bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state) { if (!Context.CurrentPluginMetadata.Disabled && _settings.ReplaceWinR) {