summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-05 14:02:00 -0400
committerpommicket <pommicket@gmail.com>2023-08-05 14:02:00 -0400
commit4726bd906ac8c165a10d819a33ccb3697f8040a9 (patch)
tree8ab8d0357ceecf281fef89a6c21444c6a73f8d95 /buffer.c
parent4ab3631aadcd27df708a16f6bf22953e0ff9b1cf (diff)
more plugin prep
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 3f32585..4393f0f 100644
--- a/buffer.c
+++ b/buffer.c
@@ -14,6 +14,16 @@ struct Line {
char32_t *str;
};
+// This refers to replacing prev_len characters (found in prev_text) at pos with new_len characters
+struct BufferEdit {
+ bool chain; // should this + the next edit be treated as one?
+ BufferPos pos;
+ u32 new_len;
+ u32 prev_len;
+ char32_t *prev_text;
+ double time; // time at start of edit (i.e. the time just before the edit), in seconds since epoch
+};
+
// this is a macro so we get -Wformat warnings
#define buffer_error(buffer, ...) \
snprintf(buffer->error, sizeof buffer->error - 1, __VA_ARGS__)