Skip to content

Commit d421a95

Browse files
committed
Add special ctrl for Pluginsmanager and Shell plugin
1 parent 41c3f8a commit d421a95

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ internal async ValueTask<List<Result>> RequestInstallOrUpdate(string searchName,
319319
IcoPath = icoPath,
320320
Action = e =>
321321
{
322+
if (e.SpecialKeyState.CtrlPressed)
323+
{
324+
SearchWeb.NewTabInBrowser(x.Website);
325+
return ShouldHideWindow;
326+
}
327+
322328
Application.Current.MainWindow.Hide();
323329
_ = InstallOrUpdate(x); // No need to wait
324330
return ShouldHideWindow;

Plugins/Flow.Launcher.Plugin.Shell/Main.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public List<Result> Query(Query query)
8686
IcoPath = Image,
8787
Action = c =>
8888
{
89-
Execute(Process.Start, PrepareProcessStartInfo(m));
89+
Execute(Process.Start, PrepareProcessStartInfo(m, c.SpecialKeyState.CtrlPressed));
9090
return true;
9191
}
9292
}));
@@ -182,7 +182,7 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
182182
if (_settings.Shell == Shell.Cmd)
183183
{
184184
var arguments = _settings.LeaveShellOpen ? $"/k \"{command}\"" : $"/c \"{command}\" & pause";
185-
185+
186186
info = ShellCommand.SetProcessStartInfo("cmd.exe", workingDirectory, arguments, runAsAdministratorArg);
187187
}
188188
else if (_settings.Shell == Shell.Powershell)
@@ -232,19 +232,19 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
232232
return info;
233233
}
234234

235-
private void Execute(Func<ProcessStartInfo, Process> startProcess,ProcessStartInfo info)
235+
private void Execute(Func<ProcessStartInfo, Process> startProcess, ProcessStartInfo info)
236236
{
237237
try
238238
{
239-
startProcess(info);
239+
startProcess(info);
240240
}
241241
catch (FileNotFoundException e)
242242
{
243243
var name = "Plugin: Shell";
244244
var message = $"Command not found: {e.Message}";
245245
context.API.ShowMsg(name, message);
246246
}
247-
catch(Win32Exception e)
247+
catch (Win32Exception e)
248248
{
249249
var name = "Plugin: Shell";
250250
var message = $"Error running the command: {e.Message}";

0 commit comments

Comments
 (0)