chiark / gitweb /
Allow error reporting as a PhysicalAction.
authorSimon Tatham <anakin@pobox.com>
Fri, 29 Dec 2023 11:09:46 +0000 (11:09 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 29 Dec 2023 11:09:46 +0000 (11:09 +0000)
Could easily come in useful!

src/tui.rs

index e3177570daee704fc733a86bf6147feba42c9ed6..7602efc1e69c18e25f79626ede5a5573e7d98f9c 100644 (file)
@@ -124,6 +124,7 @@ pub enum PhysicalAction {
     Nothing,
     Beep,
     Exit,
+    Error(TuiError),
 }
 
 pub struct Tui {
@@ -289,11 +290,14 @@ impl Tui {
                                             Self::beep()?
                                         },
 
-                                        // FIXME: errors?
                                         PhysicalAction::Exit => {
                                             break 'outer Ok(());
                                         },
 
+                                        PhysicalAction::Error(err) => {
+                                            break 'outer Err(err);
+                                        },
+
                                         PhysicalAction::Nothing => (),
                                     }
                                 }