mirror of
https://github.com/mawww/kakoune.git
synced 2024-09-20 09:19:24 +03:00
Fix crash when iterating through options on window creation
Window::on_option_changed calls hooks, which can do anything including adding/removing options in the various option managers Fixes #1863
This commit is contained in:
parent
69a0ad09b4
commit
35d68d2f82
@ -30,7 +30,10 @@ Window::Window(Buffer& buffer)
|
||||
|
||||
setup_builtin_highlighters(m_builtin_highlighters.group());
|
||||
|
||||
for (auto& option : options().flatten_options())
|
||||
// gather as on_option_changed can mutate the option managers
|
||||
for (auto& option : options().flatten_options()
|
||||
| transform([](auto& ptr) { return ptr.get(); })
|
||||
| gather<Vector<const Option*>>())
|
||||
on_option_changed(*option);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user