@@ -16,12 +16,6 @@ namespace SourceGit.ViewModels
1616{
1717 public partial class CommitDetail : ObservableObject
1818 {
19- public DiffContext DiffContext
20- {
21- get => _diffContext ;
22- private set => SetProperty ( ref _diffContext , value ) ;
23- }
24-
2519 public int ActivePageIndex
2620 {
2721 get => _repo . CommitDetailActivePageIndex ;
@@ -57,6 +51,18 @@ public Models.CommitSignInfo SignInfo
5751 private set => SetProperty ( ref _signInfo , value ) ;
5852 }
5953
54+ public List < Models . CommitLink > WebLinks
55+ {
56+ get ;
57+ private set ;
58+ } = [ ] ;
59+
60+ public List < string > Children
61+ {
62+ get => _children ;
63+ private set => SetProperty ( ref _children , value ) ;
64+ }
65+
6066 public List < Models . Change > Changes
6167 {
6268 get => _changes ;
@@ -84,10 +90,10 @@ public List<Models.Change> SelectedChanges
8490 }
8591 }
8692
87- public List < string > Children
93+ public DiffContext DiffContext
8894 {
89- get => _children ;
90- private set => SetProperty ( ref _children , value ) ;
95+ get => _diffContext ;
96+ private set => SetProperty ( ref _diffContext , value ) ;
9197 }
9298
9399 public string SearchChangeFilter
@@ -108,53 +114,13 @@ public object ViewRevisionFileContent
108114 set => SetProperty ( ref _viewRevisionFileContent , value ) ;
109115 }
110116
111- public List < Models . CommitLink > WebLinks
112- {
113- get ;
114- private set ;
115- } = [ ] ;
116-
117117 public string RevisionFileSearchFilter
118118 {
119119 get => _revisionFileSearchFilter ;
120120 set
121121 {
122122 if ( SetProperty ( ref _revisionFileSearchFilter , value ) )
123- {
124- if ( ! string . IsNullOrEmpty ( value ) )
125- {
126- if ( _revisionFiles == null )
127- {
128- var sha = Commit . SHA ;
129-
130- Task . Run ( ( ) =>
131- {
132- var files = new Commands . QueryRevisionFileNames ( _repo . FullPath , sha ) . Result ( ) ;
133- var filesList = new List < string > ( ) ;
134- filesList . AddRange ( files ) ;
135-
136- Dispatcher . UIThread . Invoke ( ( ) =>
137- {
138- if ( sha == Commit . SHA )
139- {
140- _revisionFiles = filesList ;
141- if ( ! string . IsNullOrEmpty ( _revisionFileSearchFilter ) )
142- UpdateRevisionFileSearchSuggestion ( ) ;
143- }
144- } ) ;
145- } ) ;
146- }
147- else
148- {
149- UpdateRevisionFileSearchSuggestion ( ) ;
150- }
151- }
152- else
153- {
154- RevisionFileSearchSuggestion = null ;
155- GC . Collect ( ) ;
156- }
157- }
123+ RefreshRevisionSearchSuggestion ( ) ;
158124 }
159125 }
160126
@@ -832,7 +798,44 @@ private void TryToAddContextMenuItemsForGitLFS(ContextMenu menu, string path)
832798 menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
833799 }
834800
835- private void UpdateRevisionFileSearchSuggestion ( )
801+ private void RefreshRevisionSearchSuggestion ( )
802+ {
803+ if ( ! string . IsNullOrEmpty ( _revisionFileSearchFilter ) )
804+ {
805+ if ( _revisionFiles == null )
806+ {
807+ var sha = Commit . SHA ;
808+
809+ Task . Run ( ( ) =>
810+ {
811+ var files = new Commands . QueryRevisionFileNames ( _repo . FullPath , sha ) . Result ( ) ;
812+ var filesList = new List < string > ( ) ;
813+ filesList . AddRange ( files ) ;
814+
815+ Dispatcher . UIThread . Invoke ( ( ) =>
816+ {
817+ if ( sha == Commit . SHA )
818+ {
819+ _revisionFiles = filesList ;
820+ if ( ! string . IsNullOrEmpty ( _revisionFileSearchFilter ) )
821+ CalcRevisionFileSearchSuggestion ( ) ;
822+ }
823+ } ) ;
824+ } ) ;
825+ }
826+ else
827+ {
828+ CalcRevisionFileSearchSuggestion ( ) ;
829+ }
830+ }
831+ else
832+ {
833+ RevisionFileSearchSuggestion = null ;
834+ GC . Collect ( ) ;
835+ }
836+ }
837+
838+ private void CalcRevisionFileSearchSuggestion ( )
836839 {
837840 var suggestion = new List < string > ( ) ;
838841 foreach ( var file in _revisionFiles )
0 commit comments