summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-05-21 20:07:25 +1000
committerMaxime Coste <mawww@kakoune.org>2018-05-21 20:07:25 +1000
commitd4e36958f851000be58c427517fbf65aee68bd84 (patch)
tree61c3ac246dd628e4c3b7efc05da23b7e5c1f2280 /src/buffer.cc
parent919b7ce64544df478c67fc83d5e4c2d4b5a4ffb0 (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.cc4
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);
}