summaryrefslogtreecommitdiff
path: root/src/buffer.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-06-25 13:36:23 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-06-25 13:36:23 +0100
commitcc09c36fe0f6c52ea0dfde0e095118ffa7235a50 (patch)
tree8007fa7b4a4cc971af6f1e14a4294d2e7bd028c2 /src/buffer.hh
parent26cfd6af9b6d738485dc3e34d92417ef0092c269 (diff)
Minor reorganisation in buffer.hh
Diffstat (limited to 'src/buffer.hh')
-rw-r--r--src/buffer.hh19
1 files 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<Modification, MemoryDomain::BufferMeta>;
+ using History = Vector<UndoGroup, MemoryDomain::BufferMeta>;
- using History = Vector<UndoGroup, MemoryDomain::BufferMeta>;
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<Change, MemoryDomain::BufferMeta> 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;
};