cursor_as_sgr now works on GPUCells becomes cell_as_sgr

This commit is contained in:
Dominique Martinet
2018-09-18 08:49:41 +09:00
parent f76c8ad30b
commit 2fe17aa889
4 changed files with 46 additions and 26 deletions

View File

@@ -1406,7 +1406,6 @@ screen_request_capabilities(Screen *self, char c, PyObject *q) {
static char buf[128];
int shape = 0;
const char *query;
Cursor blank_cursor = {{0}};
switch(c) {
case '+':
CALLBACK("request_capabilities", "O", q);
@@ -1430,7 +1429,13 @@ screen_request_capabilities(Screen *self, char c, PyObject *q) {
shape = snprintf(buf, sizeof(buf), "1$r%d q", shape);
} else if (strcmp("m", query) == 0) {
// SGR
shape = snprintf(buf, sizeof(buf), "1$r%sm", cursor_as_sgr(self->cursor, &blank_cursor));
GPUCell blank_cell = { 0 }, cursor_cell = {
.attrs = CURSOR_TO_ATTRS(self->cursor, 1),
.fg = self->cursor->fg & COL_MASK,
.bg = self->cursor->bg & COL_MASK,
.decoration_fg = self->cursor->decoration_fg & COL_MASK,
};
shape = snprintf(buf, sizeof(buf), "1$r%sm", cell_as_sgr(&cursor_cell, &blank_cell));
} else if (strcmp("r", query) == 0) {
shape = snprintf(buf, sizeof(buf), "1$r%u;%ur", self->margin_top + 1, self->margin_bottom + 1);
} else {