refactor: remove new_config from EditorConfigDidChange event

There is no need for it because we have access to `Editor::config()`
This commit is contained in:
Nik Revenco 2025-03-25 13:03:20 +00:00
parent d34074af1b
commit b9f8226208
3 changed files with 1 additions and 3 deletions
helix-term/src
helix-view/src

View file

@ -367,7 +367,6 @@ impl Application {
let mut app_config = (*self.config.load().clone()).clone();
helix_event::dispatch(EditorConfigDidChange {
old_config: &app_config.editor,
new_config: &editor_config,
editor: &mut self.editor,
});
app_config.editor = *editor_config;

View file

@ -77,7 +77,7 @@ pub(super) fn register_hooks(handlers: &Handlers) {
register_hook!(move |event: &mut EditorConfigDidChange<'_>| {
let has_enabled_inline_blame = event.old_config.inline_blame.behaviour
== InlineBlameBehaviour::Disabled
&& event.new_config.inline_blame.behaviour != InlineBlameBehaviour::Disabled;
&& event.editor.config().inline_blame.behaviour != InlineBlameBehaviour::Disabled;
if has_enabled_inline_blame {
// request blame for all documents, since any of them could have

View file

@ -19,7 +19,6 @@ events! {
}
EditorConfigDidChange<'a> {
old_config: &'a Config,
new_config: &'a Config,
editor: &'a mut Editor
}
DocumentDidClose<'a> {