mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
CmdPal: Fix paths to dirs on the Run fallback (#40850)
We were being too clever with `\`; and yet simultaneously not clever enough. * When we saw `c:\users`, we'd treat that as a path with a Title `users\` * but when we saw `c:\users\`, we'd fail to find a file name, and the just treat the name as `\`. That was dumb. * And we'd add trailing `\`'s even if there already was one. * But then if the user typed `c:\users`, we would immediately start enumerating children of that dir, which didn't really feel right This PR fixes all of that. Closes #40797
This commit is contained in:
@@ -154,11 +154,11 @@ internal sealed partial class FallbackExecuteItem : FallbackCommandItem, IDispos
|
||||
else if (pathIsDir)
|
||||
{
|
||||
var pathItem = new PathListItem(exe, query, _addToHistory);
|
||||
Command = pathItem.Command;
|
||||
MoreCommands = pathItem.MoreCommands;
|
||||
Title = pathItem.Title;
|
||||
Subtitle = pathItem.Subtitle;
|
||||
Icon = pathItem.Icon;
|
||||
Command = pathItem.Command;
|
||||
MoreCommands = pathItem.MoreCommands;
|
||||
}
|
||||
else if (System.Uri.TryCreate(searchText, UriKind.Absolute, out var uri))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user