mirror of https://github.com/bobwen-dev/hunter
store multi-selection in array on quit
This commit is contained in:
parent
d5ccfb0d74
commit
c47247a0bc
|
@ -803,13 +803,19 @@ impl FileBrowser {
|
||||||
let cwd = self.cwd()?.clone().path;
|
let cwd = self.cwd()?.clone().path;
|
||||||
let selected_file = self.selected_file()?;
|
let selected_file = self.selected_file()?;
|
||||||
let selected_file = selected_file.path.to_string_lossy();
|
let selected_file = selected_file.path.to_string_lossy();
|
||||||
|
let selected_files = self.selected_files()?;
|
||||||
|
|
||||||
|
let selected_files = selected_files.iter().map(|f| {
|
||||||
|
format!("\"{}\" ", &f.path.to_string_lossy())
|
||||||
|
}).collect::<String>();
|
||||||
|
|
||||||
let mut filepath = dirs_2::home_dir()?;
|
let mut filepath = dirs_2::home_dir()?;
|
||||||
filepath.push(".hunter_cwd");
|
filepath.push(".hunter_cwd");
|
||||||
|
|
||||||
let output = format!("HUNTER_CWD=\"{}\"\nF=\"{}\"",
|
let output = format!("HUNTER_CWD=\"{}\"\nF=\"{}\"\nMF=({})\n",
|
||||||
cwd.to_str()?,
|
cwd.to_str()?,
|
||||||
selected_file);
|
selected_file,
|
||||||
|
selected_files);
|
||||||
|
|
||||||
let mut file = std::fs::File::create(filepath)?;
|
let mut file = std::fs::File::create(filepath)?;
|
||||||
file.write(output.as_bytes())?;
|
file.write(output.as_bytes())?;
|
||||||
|
|
Loading…
Reference in New Issue