From 85387b3efecec5e291a5ffaf20ab227f6094bd7b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 9 Jan 2014 21:01:29 +0000 Subject: Buffers can hold arbitrary values for for other systems --- src/buffer.hh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/buffer.hh') diff --git a/src/buffer.hh b/src/buffer.hh index 9c648625..17de0f07 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -6,6 +6,7 @@ #include "option_manager.hh" #include "keymap_manager.hh" #include "string.hh" +#include "value.hh" #include #include @@ -166,6 +167,8 @@ public: KeymapManager& keymaps() { return m_keymaps; } const KeymapManager& keymaps() const { return m_keymaps; } + ValueMap& values() const { return m_values; } + void run_hook_in_own_context(const String& hook_name, const String& param); std::unordered_set& change_listeners() const { return m_change_listeners; } @@ -224,6 +227,10 @@ private: HookManager m_hooks; KeymapManager m_keymaps; + // Values are just data holding by the buffer, so it is part of its + // observable state + mutable ValueMap m_values; + friend constexpr Flags operator|(Flags lhs, Flags rhs) { return (Flags)((int) lhs | (int) rhs); -- cgit v1.2.3