diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-05-21 20:07:25 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-05-21 20:07:25 +1000 |
| commit | d4e36958f851000be58c427517fbf65aee68bd84 (patch) | |
| tree | 61c3ac246dd628e4c3b7efc05da23b7e5c1f2280 /src/buffer.cc | |
| parent | 919b7ce64544df478c67fc83d5e4c2d4b5a4ffb0 (diff) | |
Gather options in a vector when running Buffer::on_option_changed
on_option_changed might trigger hooks that will mutate the option
managers, invalidating the iterators we use.
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/buffer.cc b/src/buffer.cc index d82b4627..3b636734 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -127,7 +127,9 @@ void Buffer::on_registered() } } - for (auto& option : options().flatten_options()) + for (auto& option : options().flatten_options() + | transform(&std::unique_ptr<Option>::get) + | gather<Vector<Option*>>()) on_option_changed(*option); } |
