From d3499ecd9cc7b2b685d1bc96ac7591f29a1752ce Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 8 Sep 2011 00:13:19 +0000 Subject: Window lifetime is now handled by it's buffer. A window cannot outlive it's buffer, so it makes sense to keep only a reference on it hand have the buffer manage the window lifetime. --- src/buffer.hh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/buffer.hh') diff --git a/src/buffer.hh b/src/buffer.hh index 60306647..28a87fc4 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -3,6 +3,8 @@ #include #include +#include +#include #include "utils.hh" @@ -10,6 +12,8 @@ namespace Kakoune { class Buffer; +class Window; + typedef int BufferPos; typedef int BufferSize; typedef char BufferChar; @@ -96,6 +100,9 @@ public: const BufferString& content() const { return m_content; } + void register_window(Window* window); + void delete_window(Window* window); + private: BufferChar at(BufferPos position) const; @@ -140,6 +147,8 @@ private: void revert_modification(const Modification& modification); void append_modification(Modification&& modification); + + std::list> m_windows; }; } -- cgit v1.2.3