mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.0550: some changes in the libvterm upstream code
Problem: Some changes in the libvterm upstream code. Solution: Include some changes.
This commit is contained in:
parent
3b922f1138
commit
88c1ee84d6
@ -65,6 +65,21 @@ static VTermScreen *screen;
|
|||||||
|
|
||||||
static VTermEncodingInstance encoding;
|
static VTermEncodingInstance encoding;
|
||||||
|
|
||||||
|
static void term_output(const char *s, size_t len, void *user)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
printf("output ");
|
||||||
|
for(i = 0; i < len; i++)
|
||||||
|
printf("%x%s", (unsigned char)s[i], i < len-1 ? "," : "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void printhex(const char *s, size_t len)
|
||||||
|
{
|
||||||
|
while(len--)
|
||||||
|
printf("%02x", (s++)[0]);
|
||||||
|
}
|
||||||
|
|
||||||
static int parser_text(const char bytes[], size_t len, void *user UNUSED)
|
static int parser_text(const char bytes[], size_t len, void *user UNUSED)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -90,8 +105,6 @@ static int parser_control(unsigned char control, void *user UNUSED)
|
|||||||
|
|
||||||
static int parser_escape(const char bytes[], size_t len, void *user UNUSED)
|
static int parser_escape(const char bytes[], size_t len, void *user UNUSED)
|
||||||
{
|
{
|
||||||
size_t i;
|
|
||||||
|
|
||||||
if(bytes[0] >= 0x20 && bytes[0] < 0x30) {
|
if(bytes[0] >= 0x20 && bytes[0] < 0x30) {
|
||||||
if(len < 2)
|
if(len < 2)
|
||||||
return -1;
|
return -1;
|
||||||
@ -102,8 +115,7 @@ static int parser_escape(const char bytes[], size_t len, void *user UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("escape ");
|
printf("escape ");
|
||||||
for(i = 0; i < len; i++)
|
printhex(bytes, len);
|
||||||
printf("%02x", bytes[i]);
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
@ -142,11 +154,9 @@ static int parser_csi(const char *leader, const long args[], int argcount, const
|
|||||||
|
|
||||||
static int parser_osc(const char *command, size_t cmdlen, void *user UNUSED)
|
static int parser_osc(const char *command, size_t cmdlen, void *user UNUSED)
|
||||||
{
|
{
|
||||||
size_t i;
|
|
||||||
|
|
||||||
printf("osc ");
|
printf("osc ");
|
||||||
for(i = 0; i < cmdlen; i++)
|
printhex(command, cmdlen);
|
||||||
printf("%02x", command[i]);
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -154,11 +164,9 @@ static int parser_osc(const char *command, size_t cmdlen, void *user UNUSED)
|
|||||||
|
|
||||||
static int parser_dcs(const char *command, size_t cmdlen, void *user UNUSED)
|
static int parser_dcs(const char *command, size_t cmdlen, void *user UNUSED)
|
||||||
{
|
{
|
||||||
size_t i;
|
|
||||||
|
|
||||||
printf("dcs ");
|
printf("dcs ");
|
||||||
for(i = 0; i < cmdlen; i++)
|
printhex(command, cmdlen);
|
||||||
printf("%02x", command[i]);
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -928,13 +936,10 @@ int main(int argc UNUSED, char **argv UNUSED)
|
|||||||
|
|
||||||
outlen = vterm_output_get_buffer_current(vt);
|
outlen = vterm_output_get_buffer_current(vt);
|
||||||
if(outlen > 0) {
|
if(outlen > 0) {
|
||||||
size_t i;
|
|
||||||
char outbuff[1024];
|
char outbuff[1024];
|
||||||
vterm_output_read(vt, outbuff, outlen);
|
vterm_output_read(vt, outbuff, outlen);
|
||||||
|
|
||||||
printf("output ");
|
term_output(outbuff, outlen, NULL);
|
||||||
for(i = 0; i < outlen; i++)
|
|
||||||
printf("%x%s", (unsigned char)outbuff[i], i < outlen-1 ? "," : "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(err ? "?\n" : "DONE\n");
|
printf(err ? "?\n" : "DONE\n");
|
||||||
|
@ -738,6 +738,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
550,
|
||||||
/**/
|
/**/
|
||||||
549,
|
549,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user