From 77eb86bcdb4e2bf1b9663ccc0781abbbbd8b61bf Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 26 Sep 2012 14:27:23 +0200 Subject: [PATCH] Forbid context copy --- src/commands.cc | 2 +- src/context.hh | 1 + src/main.cc | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index dd06aa75..3e02cb26 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -504,7 +504,7 @@ void add_hook(const CommandParameters& params, Context& context) auto hook_func = [=](const String& param, const Context& context) { if (boost::regex_match(param.begin(), param.end(), regex)) { - Context new_context(context); + Context new_context(context.editor()); CommandManager::instance().execute(command, new_context); } }; diff --git a/src/context.hh b/src/context.hh index a30a16bc..801cb289 100644 --- a/src/context.hh +++ b/src/context.hh @@ -23,6 +23,7 @@ struct Context Context(Editor&& editor) : m_editor(&editor) {} + Context(const Context&) = delete; Context& operator=(const Context&) = delete; Buffer& buffer() const diff --git a/src/main.cc b/src/main.cc index 92e6247d..17f37a7a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -27,7 +27,6 @@ using namespace Kakoune; using namespace std::placeholders; - namespace Kakoune {