diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2011-11-26 18:32:57 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2011-11-26 18:32:57 +0000 |
| commit | 957446dee480ddd3cc4454a60b718bda35d9dbf6 (patch) | |
| tree | 72e72c70e223af766dfc54512759f4055fbd35c9 /src/context.hh | |
| parent | 417802cbdfaa06bb3071fd648ad0536b64fcda21 (diff) | |
Add a Context parameter to commands
Diffstat (limited to 'src/context.hh')
| -rw-r--r-- | src/context.hh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/context.hh b/src/context.hh new file mode 100644 index 00000000..6ad5bf73 --- /dev/null +++ b/src/context.hh @@ -0,0 +1,23 @@ +#ifndef context_hh_INCLUDED +#define context_hh_INCLUDED + +#include "window.hh" + +namespace Kakoune +{ + +struct Context +{ + Window* window; + Buffer* buffer; + + Context() + : window(nullptr), buffer(nullptr) {} + Context(Window& window) + : window(&window), buffer(&window.buffer()) {} + Context(Buffer& buffer) + : window(nullptr), buffer(&buffer) {} +}; + +} +#endif // context_hh_INCLUDED |
