junie-undo

This commit is contained in:
2025-11-29 11:55:55 -08:00
parent a574df2ab7
commit 0cfb06dff2
9 changed files with 388 additions and 57 deletions

11
undo.h
View File

@@ -1,13 +1,16 @@
#include <stddef.h>
#include "abuf.h"
#include "editor.h"
#include "buffer.h"
#ifndef KE_UNDO_H
#define KE_UNDO_H
struct buffer;
typedef enum undo_kind {
UNDO_INSERT = 1 << 0,
UNDO_UNKNOWN = 1 << 1,
@@ -42,9 +45,9 @@ void undo_append(undo_tree *tree, abuf *buf);
void undo_prependch(undo_tree *tree, char c);
void undo_appendch(undo_tree *tree, char c);
void undo_commit(undo_tree *tree);
void undo_apply(struct editor *editor);
void editor_undo(undo_tree *tree);
void editor_redo(undo_tree *tree);
void undo_apply(struct buffer *buf, int direction);
void editor_undo(struct buffer *buf);
void editor_redo(struct buffer *buf);
#endif