refactor: remove `new_config` from EditorConfigDidChange event

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

View File

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

View File

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

View File

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