aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index dd20c3f..d376c2d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -65,6 +65,11 @@ fn edit(file: &OsStr) -> Result<(), String> {
Key::CtrlQ => {
break;
}
+ Key::CtrlS => {
+ if let Err(err) = r.save(Path::new(file)) {
+ return Err(format!("write file {}: {}", file.to_string_lossy(), err));
+ }
+ }
Key::Up => {
if cursor_row == 0 {
continue;