Forbid context copy
This commit is contained in:
parent
efc069b531
commit
77eb86bcdb
|
@ -504,7 +504,7 @@ void add_hook(const CommandParameters& params, Context& context)
|
||||||
auto hook_func = [=](const String& param, const Context& context) {
|
auto hook_func = [=](const String& param, const Context& context) {
|
||||||
if (boost::regex_match(param.begin(), param.end(), regex))
|
if (boost::regex_match(param.begin(), param.end(), regex))
|
||||||
{
|
{
|
||||||
Context new_context(context);
|
Context new_context(context.editor());
|
||||||
CommandManager::instance().execute(command, new_context);
|
CommandManager::instance().execute(command, new_context);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,6 +23,7 @@ struct Context
|
||||||
Context(Editor&& editor)
|
Context(Editor&& editor)
|
||||||
: m_editor(&editor) {}
|
: m_editor(&editor) {}
|
||||||
|
|
||||||
|
Context(const Context&) = delete;
|
||||||
Context& operator=(const Context&) = delete;
|
Context& operator=(const Context&) = delete;
|
||||||
|
|
||||||
Buffer& buffer() const
|
Buffer& buffer() const
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
using namespace Kakoune;
|
using namespace Kakoune;
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
|
|
||||||
|
|
||||||
namespace Kakoune
|
namespace Kakoune
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user