Setup basic piece table like data structure.

This commit is contained in:
2026-07-28 00:31:58 +01:00
parent 27e8494fc8
commit 737c6c1d20
7 changed files with 228 additions and 5 deletions
+28
View File
@@ -0,0 +1,28 @@
#pragma once
#include "append_buffer.h"
#include "original_buffer.h"
#include "pch.h"
#include "shard.h"
struct Vase {
OriginalBuffer original;
AppendBuffer append;
std::vector<ShardPtr> undo;
uint8_t top; // of the undo stack.
uint8_t max; // for redo when no edits have been done after some undo.
ShardPtr root;
Vase(char *data, uint32_t length)
: original(data, length),
append() {
root = new Petal(
length,
original.newlines.size(),
Petal::Kind::Original,
0
);
}
};