diff options
| author | Albert Cervin <albert@acervin.com> | 2023-07-12 16:20:50 +0200 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2023-10-19 22:41:33 +0200 |
| commit | 54c9b4b533210b77be998f458ff96bdc54272f64 (patch) | |
| tree | eb434343bb1083172af50b7372d1e2745af00f8f /test/minibuffer.c | |
| parent | 3a8ae83aa13636679c151027cace905fa87ebd8e (diff) | |
| download | dged-54c9b4b533210b77be998f458ff96bdc54272f64.tar.gz dged-54c9b4b533210b77be998f458ff96bdc54272f64.tar.xz dged-54c9b4b533210b77be998f458ff96bdc54272f64.zip | |
big buffer/buffer_view rework
A buffer is only the text and the corresponding operation. A buffer view
holds information about scroll, dot and mark positions. One way to think
about it is that a buffer is stateless whereas a buffer view is stateful.
Diffstat (limited to 'test/minibuffer.c')
| -rw-r--r-- | test/minibuffer.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/test/minibuffer.c b/test/minibuffer.c index 5c5ae63..7ac6c9b 100644 --- a/test/minibuffer.c +++ b/test/minibuffer.c @@ -4,6 +4,7 @@ #include "dged/allocator.h" #include "dged/buffer.h" +#include "dged/buffer_view.h" #include "dged/command.h" #include "dged/display.h" #include "dged/minibuffer.h" @@ -32,11 +33,10 @@ void destroy() { } void test_minibuffer_echo() { - uint32_t relline, relcol; struct buffer_view view = buffer_view_create(&b, false, false); // TODO: how to clear this? - struct frame_allocator alloc = frame_allocator_create(1024); + struct frame_allocator alloc = frame_allocator_create(1024 * 1024); g_alloc = &alloc; struct command_list *list = @@ -50,13 +50,23 @@ void test_minibuffer_echo() { ASSERT(minibuffer_displaying(), "Minibuffer should now have text to display"); minibuffer_clear(); - buffer_update(&view, -1, 100, 1, list, 0, &relline, &relcol); + struct buffer_view_update_params p = { + .commands = list, + .frame_alloc = alloc_fn, + .window_id = -1, + .frame_time = 0, + .width = 100, + .height = 1, + .window_x = 0, + .window_y = 25, + }; + buffer_view_update(&view, &p); ASSERT(!minibuffer_displaying(), "Minibuffer should have nothing to display after clearing"); minibuffer_echo_timeout(0, "You will not see me"); - buffer_update(&view, -1, 100, 1, list, 0, &relline, &relcol); + buffer_view_update(&view, &p); ASSERT(!minibuffer_displaying(), "A zero timeout echo should be cleared after first update"); |
