summaryrefslogtreecommitdiff
path: root/src/undo.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2023-04-06 23:23:46 +0200
committerAlbert Cervin <albert@acervin.com>2023-05-01 22:19:14 +0200
commita123725a12e948d78badb2cb686d38548f1c633b (patch)
treec92c46134ef5536fbbf3bf08983c4f0dea1aaf58 /src/undo.h
parentb5ed4cf757afc50afb6ac499eee7b87a2648fa4c (diff)
downloaddged-a123725a12e948d78badb2cb686d38548f1c633b.tar.gz
dged-a123725a12e948d78badb2cb686d38548f1c633b.tar.xz
dged-a123725a12e948d78badb2cb686d38548f1c633b.zip
Implement window handling
Also implement searching. fix undo boundaries when it checked for other save point, it used && instead of == which caused it to overwrite other types. Fix bytes vs chars bug in text_get_region
Diffstat (limited to 'src/undo.h')
-rw-r--r--src/undo.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/undo.h b/src/undo.h
deleted file mode 100644
index 1ce3a8a..0000000
--- a/src/undo.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "vec.h"
-#include <stdbool.h>
-#include <stdint.h>
-
-enum undo_record_type {
- Undo_Boundary = 1,
- Undo_Add = 2,
- Undo_Delete = 3,
-};
-
-struct position {
- uint32_t row;
- uint32_t col;
-};
-
-struct undo_boundary {
- bool save_point;
-};
-
-struct undo_add {
- struct position begin;
- struct position end;
-};
-
-struct undo_delete {
- struct position pos;
- uint8_t *data;
- uint32_t nbytes;
-};
-
-struct undo_record {
- enum undo_record_type type;
-
- union {
- struct undo_boundary boundary;
- struct undo_add add;
- struct undo_delete delete;
- };
-};
-
-#define INVALID_TOP -1
-
-struct undo_stack {
- VEC(struct undo_record) records;
- uint32_t top;
- bool undo_in_progress;
-};
-
-void undo_init(struct undo_stack *undo, uint32_t initial_capacity);
-void undo_clear(struct undo_stack *undo);
-void undo_destroy(struct undo_stack *undo);
-
-uint32_t undo_push_boundary(struct undo_stack *undo,
- struct undo_boundary boundary);
-
-uint32_t undo_push_add(struct undo_stack *undo, struct undo_add add);
-uint32_t undo_push_delete(struct undo_stack *undo, struct undo_delete delete);
-
-void undo_begin(struct undo_stack *undo);
-void undo_next(struct undo_stack *undo, struct undo_record **records_out,
- uint32_t *nrecords_out);
-void undo_end(struct undo_stack *undo);
-
-uint32_t undo_size(struct undo_stack *undo);
-uint32_t undo_current_position(struct undo_stack *undo);
-const char *undo_dump(struct undo_stack *undo);