aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorCharlie Groves2022-10-21 01:35:02 +0000
committerGitHub2022-10-21 01:35:02 +0000
commit7e29ee6daeb86fbd20a8b5eaae30b2e0f868147d (patch)
tree07babf558f7aea19346e49f2cdb5862ed62489ca /helix-view
parent4ff5feeb0c6c1ce012aa1179a44f35b6f0df4da1 (diff)
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 <blaz@mxxn.io> * Need a block_try_flush_writes in all quit_all paths Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/editor.rs3
1 files changed, 3 insertions, 0 deletions
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,