summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-10-10 13:57:15 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-10-10 13:59:55 +0200
commit4c8b4890e669f4fbd902dbdd9607a3df647863c9 (patch)
tree22e50909249c21cecf3f4b4bb8c7da15d484cbff /src
parent74cdeb5952d478ec72b7bee8933d801ef76f2353 (diff)
Context: explicit constructors and more comments
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;