mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
refactor: rewrite searching commit by file path
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
fa4d9d24e9
commit
64a41dce39
3 changed files with 53 additions and 76 deletions
|
@ -134,7 +134,7 @@ namespace SourceGit.Views
|
|||
}
|
||||
else if (e.Key == Key.Down)
|
||||
{
|
||||
if (repo.IsSearchCommitSuggestionOpen)
|
||||
if (repo.MatchedFilesForSearching is { Count: > 0 })
|
||||
{
|
||||
SearchSuggestionBox.Focus(NavigationMethod.Tab);
|
||||
SearchSuggestionBox.SelectedIndex = 0;
|
||||
|
@ -144,12 +144,7 @@ namespace SourceGit.Views
|
|||
}
|
||||
else if (e.Key == Key.Escape)
|
||||
{
|
||||
if (repo.IsSearchCommitSuggestionOpen)
|
||||
{
|
||||
repo.SearchCommitFilterSuggestion.Clear();
|
||||
repo.IsSearchCommitSuggestionOpen = false;
|
||||
}
|
||||
|
||||
repo.ClearMatchedFilesForSearching();
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
@ -369,9 +364,7 @@ namespace SourceGit.Views
|
|||
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
repo.IsSearchCommitSuggestionOpen = false;
|
||||
repo.SearchCommitFilterSuggestion.Clear();
|
||||
|
||||
repo.ClearMatchedFilesForSearching();
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.Enter && SearchSuggestionBox.SelectedItem is string content)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue