Skip to content

Commit d98d387

Browse files
Merge pull request #13 from JonahFintzDev/11-clear-searchtext-when-exitreopen
feat: pass VSCodePage instance to OpenVSCodeCommand for search text reset
2 parents 7b20829 + 92f2c13 commit d98d387

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

VsCode/Commands/OpenVsCodeCommand.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ internal sealed partial class OpenVSCodeCommand : InvokableCommand
1010
public override string Name => "Open VS Code";
1111
private string workspacePath;
1212
private string executablePath;
13+
private VSCodePage page;
1314

1415
/// <summary>
1516
/// Initializes a new instance of the <see cref="OpenVSCodeCommand"/> class.
1617
/// </summary>
1718
/// <param name="executablePath">The path to the VS Code executable.</param>
1819
/// <param name="workspacePath">The path to the workspace to open.</param>
19-
public OpenVSCodeCommand(string executablePath, string workspacePath)
20+
public OpenVSCodeCommand(string executablePath, string workspacePath, VSCodePage page)
2021
{
2122
this.workspacePath = workspacePath;
2223
this.executablePath = executablePath;
24+
this.page = page;
2325
}
2426

2527
/// <summary>
@@ -41,6 +43,9 @@ public override CommandResult Invoke()
4143

4244
ShellHelpers.OpenInShell(executablePath, arguments, null, ShellHelpers.ShellRunAsType.None, false);
4345

46+
// reset search text
47+
page.UpdateSearchText(page.SearchText, string.Empty);
48+
4449
return CommandResult.Hide();
4550
}
4651
}

VsCode/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Identity
1313
Name="JonahFintzDEV.602808C55E867"
1414
Publisher="CN=240FD63B-E96D-4F79-A6D2-BFC6E6AD6C10"
15-
Version="1.3.0.0" />
15+
Version="1.4.0.0" />
1616

1717

1818
<Properties>

VsCode/Pages/VSCodePage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public override IListItem[] GetItems()
3838
foreach (var workspace in VSCodeHandler.GetWorkspaces())
3939
{
4040
// add instance to the list
41-
var command = new OpenVSCodeCommand(workspace.Instance.ExecutablePath, workspace.Path);
41+
var command = new OpenVSCodeCommand(workspace.Instance.ExecutablePath, workspace.Path, this);
4242

4343
Details details = new Details()
4444
{

0 commit comments

Comments
 (0)