Fix file saving when no file was previously open
This commit is contained in:
parent
3b048896e0
commit
022377cb48
|
|
@ -183,7 +183,8 @@ impl AppDelegate<StilettoState> for Delegate {
|
||||||
if cmd.get(commands::SAVE_FILE_AS).is_some() || cmd.get(commands::SAVE_FILE).is_some() {
|
if cmd.get(commands::SAVE_FILE_AS).is_some() || cmd.get(commands::SAVE_FILE).is_some() {
|
||||||
let mut path_buf = cmd.get(commands::SAVE_FILE_AS)
|
let mut path_buf = cmd.get(commands::SAVE_FILE_AS)
|
||||||
.map(|file_info| file_info.path().to_path_buf())
|
.map(|file_info| file_info.path().to_path_buf())
|
||||||
.unwrap_or(data.current_file_path.as_ref().cloned().unwrap());
|
.or_else(|| data.current_file_path.as_ref().cloned())
|
||||||
|
.unwrap();
|
||||||
path_buf.set_extension("stlt");
|
path_buf.set_extension("stlt");
|
||||||
|
|
||||||
let res_file = File::create(&path_buf);
|
let res_file = File::create(&path_buf);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue