mirror of https://github.com/helix-editor/helix
refactor: remove `new_config` from EditorConfigDidChange event
There is no need for it because we have access to `Editor::config()`pull/13133/head
parent
d34074af1b
commit
b9f8226208
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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> {
|
||||||
|
|
Loading…
Reference in New Issue