mirror of
https://github.com/zaphar/sheetsui.git
synced 2025-07-22 13:00:22 -04:00
fix: Some save_prompt_fixes
This commit is contained in:
parent
1604e6484d
commit
21c4dab5f4
@ -332,10 +332,14 @@ impl<'ws> Workspace<'ws> {
|
||||
fn handle_quit_dialog(&mut self, key: event::KeyEvent) -> Result<Option<ExitCode>> {
|
||||
if key.kind == KeyEventKind::Press {
|
||||
match key.code {
|
||||
KeyCode::Esc | KeyCode::Char('n') | KeyCode::Char('N') => return Ok(Some(ExitCode::SUCCESS)),
|
||||
KeyCode::Esc | KeyCode::Char('n') | KeyCode::Char('N') => {
|
||||
self.exit_quit_mode()?;
|
||||
return Ok(Some(ExitCode::SUCCESS))
|
||||
},
|
||||
KeyCode::Char('y') | KeyCode::Char('Y') => {
|
||||
// We have been asked to save the file first.
|
||||
self.save_file()?;
|
||||
self.exit_quit_mode()?;
|
||||
return Ok(Some(ExitCode::SUCCESS));
|
||||
},
|
||||
_ => return Ok(None),
|
||||
|
@ -1333,7 +1333,6 @@ fn test_quit_dialog() {
|
||||
.expect("Failed to run input script");
|
||||
assert!(!result.is_some());
|
||||
assert_eq!(ws.state.modality(), &Modality::Quit);
|
||||
assert!(result.is_some());
|
||||
|
||||
script()
|
||||
.char('n')
|
||||
|
Loading…
x
Reference in New Issue
Block a user