Refresh scrollbar auto-hide setting when opening a new editor

This commit is contained in:
Max Brunsfeld 2022-10-11 09:28:17 -07:00
parent d93e75bf5f
commit f4306d977f

View file

@ -330,10 +330,6 @@ pub fn init(cx: &mut MutableAppContext) {
cx.add_async_action(Editor::confirm_rename);
cx.add_async_action(Editor::find_all_references);
cx.set_global(ScrollbarAutoHide(
cx.platform().should_auto_hide_scrollbars(),
));
hover_popover::init(cx);
link_go_to_definition::init(cx);
mouse_context_menu::init(cx);
@ -1076,6 +1072,11 @@ impl Editor {
let editor_created_event = EditorCreated(cx.handle());
cx.emit_global(editor_created_event);
if mode == EditorMode::Full {
let should_auto_hide_scrollbars = cx.platform().should_auto_hide_scrollbars();
cx.set_global(ScrollbarAutoHide(should_auto_hide_scrollbars));
}
this.report_event("open editor", cx);
this
}