summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-term/src/application.rs5
-rw-r--r--helix-view/src/editor.rs8
2 files changed, 13 insertions, 0 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 2dfccf04..0c8de2ab 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -287,6 +287,10 @@ impl Application {
self.config.store(Arc::new(app_config));
}
}
+
+ // Update all the relevant members in the editor after updating
+ // the configuration.
+ self.editor.refresh_config();
}
fn refresh_config(&mut self) {
@@ -316,6 +320,7 @@ impl Application {
}),
);
}
+
self.config.store(Arc::new(config));
}
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 3bc3ecb1..ac19def1 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -535,6 +535,14 @@ impl Editor {
self.config.load()
}
+ /// Call if the config has changed to let the editor update all
+ /// relevant members.
+ pub fn refresh_config(&mut self) {
+ let config = self.config();
+ self.auto_pairs = (&config.auto_pairs).into();
+ self.reset_idle_timer();
+ }
+
pub fn clear_idle_timer(&mut self) {
// equivalent to internal Instant::far_future() (30 years)
self.idle_timer