diff options
| author | Albert Cervin <albert@acervin.com> | 2022-12-06 12:58:51 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2022-12-06 12:58:51 +0100 |
| commit | 66d50bd7b04922a91fbe3e4d49c68070ec1a7b14 (patch) | |
| tree | 87600e117f4262555bcc875b09e050536cbee492 /src/text.c | |
| parent | 78410b18e5d4d117b714eb9f34c689920c32a985 (diff) | |
| download | dged-66d50bd7b04922a91fbe3e4d49c68070ec1a7b14.tar.gz dged-66d50bd7b04922a91fbe3e4d49c68070ec1a7b14.tar.xz dged-66d50bd7b04922a91fbe3e4d49c68070ec1a7b14.zip | |
Add minibuffer
Diffstat (limited to 'src/text.c')
| -rw-r--r-- | src/text.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -307,13 +307,13 @@ uint32_t text_render(struct text *text, uint32_t line, uint32_t nlines, return ncmds; } -void text_for_each_chunk(struct text *text, chunk_cb callback) { +void text_for_each_chunk(struct text *text, chunk_cb callback, void *userdata) { // if representation of text is changed, this can be changed as well - text_for_each_line(text, 0, text->nlines, callback); + text_for_each_line(text, 0, text->nlines, callback, userdata); } void text_for_each_line(struct text *text, uint32_t line, uint32_t nlines, - chunk_cb callback) { + chunk_cb callback, void *userdata) { for (uint32_t li = line; li < (line + nlines); ++li) { struct line *src_line = &text->lines[li]; struct text_chunk line = (struct text_chunk){ @@ -321,7 +321,7 @@ void text_for_each_line(struct text *text, uint32_t line, uint32_t nlines, .nbytes = src_line->nbytes, .nchars = src_line->nchars, }; - callback(&line); + callback(&line, userdata); } } |
