diff options
author | Michael Davis | 2023-04-21 03:53:27 +0000 |
---|---|---|
committer | GitHub | 2023-04-21 03:53:27 +0000 |
commit | ee7413a3fd723015843e569924abbfbf32b56182 (patch) | |
tree | 2452a41519061ccff8084daf8d6acaad8a32e69e /helix-term | |
parent | 78088ac18510754c9aac27c162e4d81890a11a82 (diff) |
tui: Allow toggling mouse capture at runtime (#6675)
This picks up changes to the `editor.mouse` option at runtime - either
through `:set-option` or `:config-reload`. When the value changes, we
tell the terminal to enable or disable mouse capture sequences.
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/application.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index cda498e2..b54d6835 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -361,6 +361,9 @@ impl Application { ConfigEvent::Update(editor_config) => { let mut app_config = (*self.config.load().clone()).clone(); app_config.editor = *editor_config; + if let Err(err) = self.terminal.reconfigure(app_config.editor.clone().into()) { + self.editor.set_error(err.to_string()); + }; self.config.store(Arc::new(app_config)); } } @@ -419,6 +422,8 @@ impl Application { .map_err(|err| anyhow::anyhow!("Failed to load config: {}", err))?; self.refresh_language_config()?; self.refresh_theme(&default_config)?; + self.terminal + .reconfigure(default_config.editor.clone().into())?; // Store new config self.config.store(Arc::new(default_config)); Ok(()) |