From f053139454d9609732f5aab0e2c021bbefd04ae7 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Mon, 12 Apr 2021 20:05:30 +1000 Subject: [PATCH] use most used cmds setting --- Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs index fce934afb..4ec180793 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs @@ -124,7 +124,11 @@ namespace Flow.Launcher.Plugin.Shell } }; return ret; - }).Where(o => o != null).Take(4); + }).Where(o => o != null); + + if (_settings.ShowOnlyMostUsedCMDs) + return history.Take(_settings.ShowOnlyMostUsedCMDsNumber).ToList(); + return history.ToList(); } @@ -159,7 +163,11 @@ namespace Flow.Launcher.Plugin.Shell Execute(Process.Start, PrepareProcessStartInfo(m.Key)); return true; } - }).Take(5); + }); + + if (_settings.ShowOnlyMostUsedCMDs) + return history.Take(_settings.ShowOnlyMostUsedCMDsNumber).ToList(); + return history.ToList(); }