Skip to content

Commit aba9af5

Browse files
committed
fix: creating directory deselects marks
Signed-off-by: Luterán Lajos <[email protected]>
1 parent a225836 commit aba9af5

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/commands/tab_ops.rs

+22
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,28 @@ pub fn close_tab(context: &mut AppContext) -> AppResult {
207207
}
208208

209209
pub fn reload_all_tabs(context: &mut AppContext, curr_path: &Path) -> io::Result<()> {
210+
let mut map = HashMap::new();
211+
{
212+
let display_options = context.config_ref().display_options_ref();
213+
214+
for (id, tab) in context.tab_context_ref().iter() {
215+
let tab_options = tab.option_ref();
216+
let history = tab.history_ref();
217+
let dirlist =
218+
create_dirlist_with_history(history, curr_path, display_options, tab_options)?;
219+
map.insert(*id, dirlist);
220+
}
221+
}
222+
223+
for (id, dirlist) in map {
224+
if let Some(tab) = context.tab_context_mut().tab_mut(&id) {
225+
tab.history_mut().insert(curr_path.to_path_buf(), dirlist);
226+
}
227+
}
228+
Ok(())
229+
}
230+
231+
pub fn reload_all_tabs_no_preserve(context: &mut AppContext, curr_path: &Path) -> io::Result<()> {
210232
let mut map = HashMap::new();
211233
{
212234
let mut display_options = context.config_ref().display_options_clone();

src/event/process_event.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn process_finished_worker(context: &mut AppContext, res: AppResult<FileOper
104104

105105
let observer_path = observer.src_path();
106106
if observer_path.exists() {
107-
let _ = tab_ops::reload_all_tabs(context, observer_path);
107+
let _ = tab_ops::reload_all_tabs_no_preserve(context, observer_path);
108108
} else {
109109
tab_ops::remove_entry_from_all_tabs(context, observer_path);
110110
}

0 commit comments

Comments
 (0)