@@ -225,7 +225,7 @@ impl CommitList {
225
225
///
226
226
pub fn set_commits ( & mut self , commits : Vec < CommitId > ) {
227
227
self . commits = commits;
228
- self . fetch_commits ( ) ;
228
+ self . fetch_commits ( false ) ;
229
229
}
230
230
231
231
///
@@ -237,7 +237,7 @@ impl CommitList {
237
237
let selection_max = self . selection_max ( ) ;
238
238
239
239
if self . needs_data ( selection, selection_max) || new_commits {
240
- self . fetch_commits ( ) ;
240
+ self . fetch_commits ( false ) ;
241
241
}
242
242
}
243
243
@@ -246,10 +246,20 @@ impl CommitList {
246
246
& mut self ,
247
247
highlighting : Option < Rc < IndexSet < CommitId > > > ,
248
248
) {
249
- self . highlights = highlighting;
249
+ //note: set highlights to none if there is no highlight
250
+ self . highlights = if highlighting
251
+ . as_ref ( )
252
+ . map ( |set| set. is_empty ( ) )
253
+ . unwrap_or_default ( )
254
+ {
255
+ None
256
+ } else {
257
+ highlighting
258
+ } ;
259
+
250
260
self . select_next_highlight ( ) ;
251
261
self . set_highlighted_selection_index ( ) ;
252
- self . fetch_commits ( ) ;
262
+ self . fetch_commits ( true ) ;
253
263
}
254
264
255
265
///
@@ -713,7 +723,7 @@ impl CommitList {
713
723
self . items . needs_data ( idx, idx_max)
714
724
}
715
725
716
- fn fetch_commits ( & mut self ) {
726
+ fn fetch_commits ( & mut self , force : bool ) {
717
727
let want_min =
718
728
self . selection ( ) . saturating_sub ( SLICE_SIZE / 2 ) ;
719
729
let commits = self . commits . len ( ) ;
@@ -725,6 +735,7 @@ impl CommitList {
725
735
. index_offset_raw ( )
726
736
. map ( |index| want_min == index)
727
737
. unwrap_or_default ( )
738
+ || force
728
739
{
729
740
let slice_end =
730
741
want_min. saturating_add ( SLICE_SIZE ) . min ( commits) ;
0 commit comments