Major fixes:

- ChunkIterator is now bidirectional
- LineIterator is now also bidirectional
- Undo/redo history operations
- Replace operation
- Range based api functions
- And more minor bug fixes
This commit is contained in:
2026-08-03 20:26:02 +01:00
parent 557edb5191
commit 8c61f186cf
18 changed files with 443 additions and 188 deletions
+5 -27
View File
@@ -1,39 +1,17 @@
#include "io/file.h"
#include "pch.h"
#include "vase/iterators/chunk.h"
#include "vase/iterators/line.h"
#include "vase/shard.h"
#include "vase/vase.h"
int main(int argc, char *argv[]) {
#ifdef DEBUG
const char *text_o =
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1\n"
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz2\n"
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz3\n"
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz4";
uint32_t len = strlen(text_o);
char *text = strdup(text_o);
#else
const char *path;
if (argc >= 2)
path = argv[1];
else
if (argc < 2)
throw std::runtime_error("Please give filename.");
uint32_t len;
char *text;
read_file(path, &text, &len);
Vase vase = Vase(std::string(argv[1]));
#endif
Vase vase = Vase(text, len);
std::cout << "\n"
<< vase.to_string()
<< "\n";
return 0;
}