From 7e29ee6daeb86fbd20a8b5eaae30b2e0f868147d Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Thu, 20 Oct 2022 21:35:02 -0400 Subject: Autosave all when the terminal loses focus (#3178) * Autosave all when the terminal loses focus * Correct comment on focus config Co-authored-by: Blaž Hrastnik * Need a block_try_flush_writes in all quit_all paths Co-authored-by: Blaž Hrastnik --- helix-view/src/editor.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'helix-view/src') diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index fe243b92..af69ceea 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -140,6 +140,8 @@ pub struct Config { pub auto_completion: bool, /// Automatic formatting on save. Defaults to true. pub auto_format: bool, + /// Automatic save on focus lost. Defaults to false. + pub auto_save: bool, /// Time in milliseconds since last keypress before idle timers trigger. /// Used for autocompletion, set to 0 for instant. Defaults to 400ms. #[serde( @@ -592,6 +594,7 @@ impl Default for Config { auto_pairs: AutoPairConfig::default(), auto_completion: true, auto_format: true, + auto_save: false, idle_timeout: Duration::from_millis(400), completion_trigger_len: 2, auto_info: true, -- cgit v1.2.3-70-g09d2