Update dependencies

This commit is contained in:
Jeremy Soller 2024-02-21 09:10:53 -07:00
parent f1f71069a1
commit e956fd822b
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 34 additions and 34 deletions

View file

@ -1789,9 +1789,19 @@ impl Application for App {
if self.dialog_opt.is_none() {
let entity = self.tab_model.active();
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity) {
let (filename, path_opt) = match &tab.path_opt {
Some(path) => (
path.file_name()
.and_then(|x| x.to_str())
.map(|x| x.to_string())
.unwrap_or(String::new()),
path.parent().map(|x| x.to_path_buf()),
),
None => (String::new(), None),
};
let (dialog, command) = Dialog::new(
DialogKind::SaveFile,
tab.path_opt.clone(),
DialogKind::SaveFile { filename },
path_opt,
Message::DialogMessage,
move |result| Message::SaveAsResult(entity, result),
);