Mercurial > vim
diff src/libvterm/t/harness.c @ 20488:1d595fada804 v8.2.0798
patch 8.2.0798: libvterm code lags behind the upstream version
Commit: https://github.com/vim/vim/commit/be593bf135f6967335b14ba188bd5f8f32175c75
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 19 21:20:04 2020 +0200
patch 8.2.0798: libvterm code lags behind the upstream version
Problem: Libvterm code lags behind the upstream version.
Solution: Include revisions 755 - 758.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 19 May 2020 21:30:07 +0200 |
parents | dc88c690f19b |
children | 747a270eb1db |
line wrap: on
line diff
--- a/src/libvterm/t/harness.c +++ b/src/libvterm/t/harness.c @@ -153,21 +153,44 @@ static int parser_csi(const char *leader return 1; } -static int parser_osc(const char *command, size_t cmdlen, void *user UNUSED) +static int parser_osc(int command, VTermStringFragment frag, void *user UNUSED) { printf("osc "); - printhex(command, cmdlen); + + if(frag.initial) { + if(command == -1) + printf("["); + else + printf("[%d;", command); + } + + printhex(frag.str, frag.len); + + if(frag.final) + printf("]"); + printf("\n"); return 1; } -static int parser_dcs(const char *command, size_t cmdlen, void *user UNUSED) +static int parser_dcs(const char *command, size_t commandlen, VTermStringFragment frag, void *user UNUSED) { + printf("dcs "); - printf("dcs "); - printhex(command, cmdlen); + if(frag.initial) { + size_t i; + printf("["); + for(i = 0; i < commandlen; i++) + printf("%02x", command[i]); + } + + printhex(frag.str, frag.len); + + if(frag.final) + printf("]"); + printf("\n"); return 1; @@ -239,7 +262,8 @@ static int settermprop(VTermProp prop, V printf("settermprop %d %d\n", prop, val->number); return 1; case VTERM_VALUETYPE_STRING: - printf("settermprop %d \"%s\"\n", prop, val->string); + printf("settermprop %d %s\"%.*s\"%s\n", prop, + val->string.initial ? "[" : "", val->string.len, val->string.str, val->string.final ? "]" : ""); return 1; case VTERM_VALUETYPE_COLOR: printf("settermprop %d rgb(%d,%d,%d)\n", prop, val->color.red, val->color.green, val->color.blue); @@ -262,7 +286,7 @@ static int state_putglyph(VTermGlyphInfo return 1; printf("putglyph "); - for(i = 0; info->chars[i]; i++) + for(i = 0; i < VTERM_MAX_CHARS_PER_CELL && info->chars[i]; i++) printf(i ? ",%x" : "%x", info->chars[i]); printf(" %d %d,%d", info->width, pos.row, pos.col); if(info->protected_cell)