comparison src/libvterm/src/pen.c @ 20462:9ad473b50471 v8.2.0785

patch 8.2.0785: libvterm code lags behind the upstream version Commit: https://github.com/vim/vim/commit/6fc3b59ee914a0d1710c8b037a0c592e0a7c34d4 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 17 22:27:55 2020 +0200 patch 8.2.0785: libvterm code lags behind the upstream version Problem: Libvterm code lags behind the upstream version. Solution: Include revisions 734 - 740.
author Bram Moolenaar <Bram@vim.org>
date Sun, 17 May 2020 22:30:03 +0200
parents 1c75e1974313
children 747a270eb1db
comparison
equal deleted inserted replaced
20461:875823cde2ff 20462:9ad473b50471
259 case 3: // Italic on 259 case 3: // Italic on
260 state->pen.italic = 1; 260 state->pen.italic = 1;
261 setpenattr_bool(state, VTERM_ATTR_ITALIC, 1); 261 setpenattr_bool(state, VTERM_ATTR_ITALIC, 1);
262 break; 262 break;
263 263
264 case 4: // Underline single 264 case 4: // Underline
265 state->pen.underline = 1; 265 state->pen.underline = VTERM_UNDERLINE_SINGLE;
266 setpenattr_int(state, VTERM_ATTR_UNDERLINE, 1); 266 if(CSI_ARG_HAS_MORE(args[argi])) {
267 argi++;
268 switch(CSI_ARG(args[argi])) {
269 case 0:
270 state->pen.underline = 0;
271 break;
272 case 1:
273 state->pen.underline = VTERM_UNDERLINE_SINGLE;
274 break;
275 case 2:
276 state->pen.underline = VTERM_UNDERLINE_DOUBLE;
277 break;
278 case 3:
279 state->pen.underline = VTERM_UNDERLINE_CURLY;
280 break;
281 }
282 }
283 setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
267 break; 284 break;
268 285
269 case 5: // Blink 286 case 5: // Blink
270 state->pen.blink = 1; 287 state->pen.blink = 1;
271 setpenattr_bool(state, VTERM_ATTR_BLINK, 1); 288 setpenattr_bool(state, VTERM_ATTR_BLINK, 1);
286 state->pen.font = CSI_ARG(args[argi]) - 10; 303 state->pen.font = CSI_ARG(args[argi]) - 10;
287 setpenattr_int(state, VTERM_ATTR_FONT, state->pen.font); 304 setpenattr_int(state, VTERM_ATTR_FONT, state->pen.font);
288 break; 305 break;
289 306
290 case 21: // Underline double 307 case 21: // Underline double
291 state->pen.underline = 2; 308 state->pen.underline = VTERM_UNDERLINE_DOUBLE;
292 setpenattr_int(state, VTERM_ATTR_UNDERLINE, 2); 309 setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
293 break; 310 break;
294 311
295 case 22: // Bold off 312 case 22: // Bold off
296 state->pen.bold = 0; 313 state->pen.bold = 0;
297 setpenattr_bool(state, VTERM_ATTR_BOLD, 0); 314 setpenattr_bool(state, VTERM_ATTR_BOLD, 0);
403 args[argi++] = 1; 420 args[argi++] = 1;
404 421
405 if(state->pen.italic) 422 if(state->pen.italic)
406 args[argi++] = 3; 423 args[argi++] = 3;
407 424
408 if(state->pen.underline == 1) 425 if(state->pen.underline == VTERM_UNDERLINE_SINGLE)
409 args[argi++] = 4; 426 args[argi++] = 4;
427 if(state->pen.underline == VTERM_UNDERLINE_CURLY)
428 args[argi++] = 4 | CSI_ARG_FLAG_MORE, args[argi++] = 3;
410 429
411 if(state->pen.blink) 430 if(state->pen.blink)
412 args[argi++] = 5; 431 args[argi++] = 5;
413 432
414 if(state->pen.reverse) 433 if(state->pen.reverse)
418 args[argi++] = 9; 437 args[argi++] = 9;
419 438
420 if(state->pen.font) 439 if(state->pen.font)
421 args[argi++] = 10 + state->pen.font; 440 args[argi++] = 10 + state->pen.font;
422 441
423 if(state->pen.underline == 2) 442 if(state->pen.underline == VTERM_UNDERLINE_DOUBLE)
424 args[argi++] = 21; 443 args[argi++] = 21;
425 444
426 if(state->fg_index >= 0 && state->fg_index < 8) 445 if(state->fg_index >= 0 && state->fg_index < 8)
427 args[argi++] = 30 + state->fg_index; 446 args[argi++] = 30 + state->fg_index;
428 else if(state->fg_index >= 8 && state->fg_index < 16) 447 else if(state->fg_index >= 8 && state->fg_index < 16)