summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/context.hh15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/context.hh b/src/context.hh
index ecca3137..7b03708e 100644
--- a/src/context.hh
+++ b/src/context.hh
@@ -8,19 +8,24 @@
namespace Kakoune
{
-// A Context is provided to all commands, it permits
-// to access a client, window, editor or buffer if available.
+// A Context is used to access non singleton objects for various services
+// in commands.
+//
+// The Context object links a Client, an Editor (which may be a Window),
+// and a UserInterface. It may represent an interactive user window, or
+// a hook execution or a macro replay.
struct Context
{
Context() {}
- Context(Editor& editor)
+ explicit Context(Editor& editor)
: m_editor(&editor) {}
- Context(Client& client)
+ explicit Context(Client& client)
: m_client(&client) {}
// to allow func(Context(Editor(...)))
- Context(Editor&& editor)
+ // make sure the context will not survive the next ';'
+ explicit Context(Editor&& editor)
: m_editor(&editor) {}
Context(const Context&) = delete;