Compare commits

..

2 Commits

Author SHA1 Message Date
Enrico Lumetti edc9b3b2c1 Add Viewport up/down scroll 2021-03-01 09:38:15 +01:00
Enrico Lumetti 022377cb48 Fix file saving when no file was previously open 2021-03-01 09:38:00 +01:00
1 changed files with 2 additions and 1 deletions

View File

@ -202,7 +202,8 @@ impl AppDelegate<StilettoState> for Delegate {
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)
.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");
let res_file = File::create(&path_buf);