From cc09c36fe0f6c52ea0dfde0e095118ffa7235a50 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 25 Jun 2015 13:36:23 +0100 Subject: [PATCH] Minor reorganisation in buffer.hh --- src/buffer.hh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/buffer.hh b/src/buffer.hh index a5e3e5ae..5bfecf85 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -171,6 +171,14 @@ private: void on_option_changed(const Option& option) override; + ByteCoord do_insert(ByteCoord pos, StringView content); + ByteCoord do_erase(ByteCoord begin, ByteCoord end); + + struct Modification; + + void apply_modification(const Modification& modification); + void revert_modification(const Modification& modification); + struct LineList : BufferLines { [[gnu::always_inline]] @@ -190,30 +198,23 @@ private: }; LineList m_lines; - ByteCoord do_insert(ByteCoord pos, StringView content); - ByteCoord do_erase(ByteCoord begin, ByteCoord end); - String m_name; Flags m_flags; - struct Modification; using UndoGroup = Vector; + using History = Vector; - using History = Vector; History m_history; History::iterator m_history_cursor; UndoGroup m_current_undo_group; - void apply_modification(const Modification& modification); - void revert_modification(const Modification& modification); - size_t m_last_save_undo_index; Vector m_changes; time_t m_fs_timestamp; - // Values are just data holding by the buffer, so it is part of its + // Values are just data holding by the buffer, they are not part of its // observable state mutable ValueMap m_values; };