File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -310,12 +310,17 @@ impl LogViewerApp {
310
310
match Data :: try_from ( ( self . row_idx_field_name . as_ref ( ) , & data[ ..] ) ) {
311
311
Ok ( mut data) => {
312
312
if let Some ( old_data) = self . data . as_mut ( ) {
313
- // Preserve filter settings across loads of the data
314
- data. filter = old_data. filter . take ( ) ;
313
+ // Preserve settings across loads of the data
314
+ data. take_config (
315
+ old_data,
316
+ self . data_display_options . common_fields ( ) ,
317
+ ) ;
315
318
}
316
319
self . data = Some ( data) ;
317
320
if self . should_scroll_to_end_on_load {
318
321
self . move_selected_last ( ) ;
322
+ } else {
323
+ self . should_scroll = true ;
319
324
}
320
325
LoadingStatus :: NotInProgress
321
326
}
Original file line number Diff line number Diff line change @@ -246,6 +246,19 @@ impl Data {
246
246
warn ! ( "Apply called but no filter is available" )
247
247
}
248
248
}
249
+
250
+ pub fn take_config ( & mut self , other : & mut Self , common_fields : & BTreeSet < String > ) {
251
+ let is_filtered = other. is_filtered ( ) ;
252
+ self . filter = other. filter . take ( ) ;
253
+ if is_filtered {
254
+ self . apply_filter ( common_fields) ;
255
+ }
256
+ if let Some ( i) = other. selected_row {
257
+ if i < self . len ( ) {
258
+ self . selected_row = Some ( i) ;
259
+ }
260
+ }
261
+ }
249
262
}
250
263
251
264
fn is_included (
You can’t perform that action at this time.
0 commit comments