2018-03-05 00:39:14 +01:00
|
|
|
#include "scope.hh"
|
|
|
|
#include "context.hh"
|
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
|
|
|
GlobalScope::GlobalScope()
|
|
|
|
: m_option_registry(m_options)
|
|
|
|
{
|
|
|
|
options().register_watcher(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
GlobalScope::~GlobalScope()
|
|
|
|
{
|
|
|
|
options().unregister_watcher(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GlobalScope::on_option_changed(const Option& option)
|
|
|
|
{
|
|
|
|
Context empty_context{Context::EmptyContextFlag{}};
|
2018-10-22 23:15:53 +02:00
|
|
|
hooks().run_hook(Hook::GlobalSetOption,
|
2019-06-18 14:18:17 +02:00
|
|
|
format("{}={}", option.name(), option.get_as_string(Quoting::Raw)),
|
2018-03-05 00:39:14 +01:00
|
|
|
empty_context);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|