diff options
author | Bjorn Ove Hay Andersen | 2022-06-15 17:29:58 +0000 |
---|---|---|
committer | GitHub | 2022-06-15 17:29:58 +0000 |
commit | 794576a5b0b9a7b9e59275acd47448525de1aac1 (patch) | |
tree | 4de2a843daf5ab7af957485e48604b7bbef11a1e /helix-view/src | |
parent | 11dadab371c126cdecd333c142175ee089692b9e (diff) |
Update auto-pairs and idle-timeout when the config is reloaded (#2736)
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/editor.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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 |