This commit is contained in:
Kovid Goyal 2024-01-18 13:50:33 +05:30
parent 0a158f3577
commit 99d1eec021
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View file

@ -148,6 +148,9 @@ linebuf_init_line(LineBuf *self, index_type idx) {
void
linebuf_clear_lines(LineBuf *self, const Cursor *cursor, index_type start, index_type end) {
#if BLANK_CHAR != 0
#error This implementation is incorrect for BLANK_CHAR != 0
#endif
GPUCell *first_gpu_line = gpu_lineptr(self, start);
GPUCell gc = cursor_as_gpu_cell(cursor);
for (index_type i = 0; i < self->xnum; i++) memcpy(first_gpu_line + i, &gc, sizeof(gc));

View file

@ -542,6 +542,9 @@ void
line_apply_cursor(Line *self, const Cursor *cursor, unsigned int at, unsigned int num, bool clear_char) {
GPUCell gc = cursor_as_gpu_cell(cursor);
if (clear_char) {
#if BLANK_CHAR != 0
#error This implementation is incorrect for BLANK_CHAR != 0
#endif
for (index_type i = at; i < self->xnum && i < at + num; i++) {
memset(self->cpu_cells + i, 0, sizeof(self->cpu_cells[0]));
memcpy(self->gpu_cells + i, &gc, sizeof(gc));