diff --git a/src/buffer.cc b/src/buffer.cc index 93808fd6..c0167193 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -514,7 +514,7 @@ void Buffer::set_fs_timestamp(time_t ts) void Buffer::on_option_changed(const Option& option) { run_hook_in_own_context("BufSetOption", - option.name() + "=" + option.get_as_string()); + format("{}={}", option.name(), option.get_as_string())); } void Buffer::run_hook_in_own_context(StringView hook_name, StringView param) diff --git a/src/window.cc b/src/window.cc index b23fcdd8..1c205d8d 100644 --- a/src/window.cc +++ b/src/window.cc @@ -285,8 +285,8 @@ ByteCoordAndTarget Window::offset_coord(ByteCoordAndTarget coord, LineCount offs void Window::on_option_changed(const Option& option) { - String desc = option.name() + "=" + option.get_as_string(); - run_hook_in_own_context("WinSetOption", desc); + run_hook_in_own_context("WinSetOption", + format("{}={}", option.name(), option.get_as_string())); // an highlighter might depend on the option, so we need to redraw forget_timestamp();