From 4f3b576db6b01c8c88076985478e2a7fa37be340 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 18 May 2023 23:51:51 +0200 Subject: TOML settings parsing Currently a very simplistic parser that do not support all TOML datatypes. Supported are: - Tables - Strings (incl multiline) - Integers - Inline Tables - Booleans - Comments --- src/dged/buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dged/buffer.c') diff --git a/src/dged/buffer.c b/src/dged/buffer.c index 7e9789a..b3b3412 100644 --- a/src/dged/buffer.c +++ b/src/dged/buffer.c @@ -307,7 +307,7 @@ bool buffer_region_has_size(struct buffer_view *view) { struct text_chunk *copy_region(struct buffer *buffer, struct region region) { struct text_chunk *curr = &g_kill_ring.buffer[g_kill_ring.curr_idx]; - g_kill_ring.curr_idx = g_kill_ring.curr_idx + 1 % KILL_RING_SZ; + g_kill_ring.curr_idx = (g_kill_ring.curr_idx + 1) % KILL_RING_SZ; if (curr->allocated) { free(curr->text); @@ -405,6 +405,7 @@ void buffer_kill_line(struct buffer_view *view) { .col = view->dot.col + nchars, }, }; + copy_region(view->buffer, reg); delete_with_undo(view->buffer, view->dot, (struct buffer_location){ -- cgit v1.2.3