mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
enhance: show suggestion popup after search commit filter type changed
This commit is contained in:
parent
1277112a5e
commit
2cfa2bf6c5
1 changed files with 25 additions and 1 deletions
|
@ -2056,7 +2056,31 @@ namespace SourceGit.ViewModels
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
var files = new Commands.QueryCurrentRevisionFiles(_fullpath).Result();
|
var files = new Commands.QueryCurrentRevisionFiles(_fullpath).Result();
|
||||||
Dispatcher.UIThread.Invoke(() => _revisionFiles.AddRange(files));
|
Dispatcher.UIThread.Invoke(() =>
|
||||||
|
{
|
||||||
|
if (_searchCommitFilterType != 3)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_revisionFiles.AddRange(files);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(_searchCommitFilter) && _searchCommitFilter.Length > 2 && _revisionFiles.Count > 0)
|
||||||
|
{
|
||||||
|
var suggestion = new List<string>();
|
||||||
|
foreach (var file in _revisionFiles)
|
||||||
|
{
|
||||||
|
if (file.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) && file.Length != _searchCommitFilter.Length)
|
||||||
|
{
|
||||||
|
suggestion.Add(file);
|
||||||
|
if (suggestion.Count > 100)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchCommitFilterSuggestion.Clear();
|
||||||
|
SearchCommitFilterSuggestion.AddRange(suggestion);
|
||||||
|
IsSearchCommitSuggestionOpen = SearchCommitFilterSuggestion.Count > 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue