@@ -5,11 +5,12 @@ use termion::event::Key;
5
5
6
6
use crate :: context:: AppContext ;
7
7
use crate :: error:: { AppError , AppErrorKind , AppResult } ;
8
- use crate :: history:: DirectoryHistory ;
9
8
use crate :: io:: { FileOperation , FileOperationOptions , IoWorkerThread } ;
10
9
use crate :: ui:: widgets:: TuiPrompt ;
11
10
use crate :: ui:: AppBackend ;
12
11
12
+ use super :: tab_ops;
13
+
13
14
fn prompt ( context : & mut AppContext , backend : & mut AppBackend , paths_len : usize ) -> bool {
14
15
let ch = {
15
16
let prompt_str = format ! ( "Delete {} files? (Y/n)" , paths_len) ;
@@ -93,14 +94,7 @@ pub fn delete_selected_files(
93
94
delete_files ( context, paths, background, permanently) ?;
94
95
}
95
96
96
- let curr_tab = context. tab_context_ref ( ) . curr_tab_ref ( ) ;
97
- let config = context. config_ref ( ) . clone ( ) ;
98
- let options = context. config_ref ( ) . display_options_ref ( ) . clone ( ) ;
99
- let curr_path = curr_tab. cwd ( ) . to_path_buf ( ) ;
100
- for ( _, tab) in context. tab_context_mut ( ) . iter_mut ( ) {
101
- let tab_options = tab. option_ref ( ) . clone ( ) ;
102
- tab. history_mut ( )
103
- . reload ( & curr_path, & config, & options, & tab_options) ?;
104
- }
97
+ let curr_path = context. tab_context_ref ( ) . curr_tab_ref ( ) . cwd ( ) . to_path_buf ( ) ;
98
+ tab_ops:: reload_all_tabs ( context, curr_path. as_path ( ) ) ?;
105
99
Ok ( ( ) )
106
100
}
0 commit comments