Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 458b0d0

Browse files
committed
Remove workaround for UpdateSearchHost crash
Now that OnStartSearch is updating IGitHubPaneViewModel on the UI thread, calling SearchAsync with a duplicate query no longer crashes. We no longer need to trim whitespace and compare.
1 parent 8bf1864 commit 458b0d0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/GitHub.VisualStudio/UI/GitHubPane.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,8 @@ void UpdateSearchHost(bool enabled, string query)
177177
{
178178
SearchHost.IsEnabled = enabled;
179179

180-
var searchString = SearchHost.SearchQuery?.SearchString;
181-
if (searchString?.Trim() != query?.Trim())
180+
if (SearchHost.SearchQuery?.SearchString != query)
182181
{
183-
// SearchAsync will crash the process if we send it a duplicate string.
184-
// There is a SearchTrimsWhitespace setting that makes searched with leading or trailing
185-
// white-space appear as duplicates. We compare the query with trimmed white-space to avoid this.
186-
// https://github.com/github/VisualStudio/issues/1948
187182
SearchHost.SearchAsync(query != null ? new SearchQuery(query) : null);
188183
}
189184
}

0 commit comments

Comments
 (0)